Skip to content

Instantly share code, notes, and snippets.

@buonzz
Created June 29, 2014 03:27
Show Gist options
  • Save buonzz/ed9171cad2c8d4b3b2c4 to your computer and use it in GitHub Desktop.
Save buonzz/ed9171cad2c8d4b3b2c4 to your computer and use it in GitHub Desktop.
avoid the nameserver to get overwritten when rebooted on centos
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.
touch /var/lock/subsys/local
# add this two lines to overwrite the nameserver value
echo "nameserver 8.8.8.8" > /etc/resolv.conf
echo "nameserver 8.8.4.4" >> /etc/resolv.conf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment