-
-
Save girvan/ef750e40245bab6c59e6 to your computer and use it in GitHub Desktop.
setup google nameserver with dhcp network settings in linux
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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