Skip to content

Instantly share code, notes, and snippets.

@girvan

girvan/shell Secret

Created August 3, 2015 03:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save girvan/ef750e40245bab6c59e6 to your computer and use it in GitHub Desktop.
Save girvan/ef750e40245bab6c59e6 to your computer and use it in GitHub Desktop.
setup google nameserver with dhcp network settings in linux
if grep -q 8.8.8.8 /etc/dhcp/dhclient.conf; then
echo 'nameserver found'
else
echo 'interface "eth0" { prepend domain-name-servers 8.8.8.8, 8.8.4.4; }' \
| sudo tee -a /etc/dhcp/dhclient.conf
sudo dhclient -v -r eth0 && sudo dhclient -v eth0
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment