Ubuntu resolv.conf file keep getting reset

For the time being, you might have noticed that the manual entry inside the file resolv.conf is getting reset and you can’t ping to the public domains. For the latest ubuntu releases, we should use resolvconf to edit the dns entries and all the manual entries added directly inside resolv.conf will be overwritten when resovconf triggers the service check

To edit the entries,
vi /etc/resolvconf/resolv.conf.d/base
Add the entries (here I am using google dns) as below :

nameserver 8.8.8.8
nameserver 8.8.4.4

Restart the service as below :

service resolvconf restart

Now you can check your resolv.conf file and you would be able to see the manual entries replicated there.

root@test:~# cat /etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 8.8.8.8
nameserver 8.8.4.4

Thanks đŸ™‚

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