Autogenerating content in /etc/resolv.conf

I encountereda serious problem with my resolv.conf file that whenever i restarts the system the file goes balnk so i didnt get network connection..So i need to edit the resolv.conf file always and enter the nameserver details..to auto fill the nameserver details in resolv.conf there’s a tricky way

cd /etc/resolvconf/resolv.conf.d
sudo cp -p head head.orig  #backup copy, always do this
sudo vim head

The top of the file is a scary warning. The file /etc/resolv.conf is autogenerated from the contents of this file; the warning is there so it will get put in /etc/resolv.conf when /etc/resolv.conf is generated. To the end of the file, add

nameserver <ip_of_nameserver>

Save and quit.To finish up, regenerate /etc/resolv.conf so the changes are applied right now:

sudo resolvconf -u

it will still be there the next time your machine boots or your network service is restarted.

Happy Hacking 🙂

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s