Skip to content

Instantly share code, notes, and snippets.

@girvan girvan/shell Secret
Created Aug 3, 2015

Embed
What would you like to do?
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
You can’t perform that action at this time.