Ubuntu – Changes to /etc/resolv.conf discarded when connecting to a new network

12.10networkingresolv.conf

I have upgraded to 12.10 from 12.04 recently and I am having issues with connecting to the Internet.

I got an IP address and am able to ping other LAN IPs in the local network but I am unable to connect to the Internet and am even unable to ping www.google.com from a terminal.

Somehow making changes in /etc/resolv.conf and restarting resolvconf service and rebooting works but I need to do this every time I connect to a new network. How do I make these changes permanent?

Can someone suggest a solution to this issue?

Best Answer

As per the header on /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

Try putting your change in

/etc/resolvconf/resolv.conf.d/base and they should get added to /etc/resolv.conf when it gets re-written every 15 minutes.

Related Question