Help - 'resolv.conf' being overwritten on startup with DNS from my old VPN settings
Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Help - 'resolv.conf' being overwritten on startup with DNS from my old VPN settings
I took me a while to get this far. After setting up VPNC at home to connect to my University network I found that I could only access the internet when the VPN was connected.
Eventually worked out it was a DNS server problem.
The Uni DNS server was at the top of the list in my 'resolv.conf' file. I have now removed the VPNC package and the config files for my Uni connection. I can manually edit the 'resolv.conf' file to remove that DNS server. This works as long as the computer is left on, but every time I restart my computer the Uni DNS server is written back into my 'resolv.conf' file.
I am using a wired network with 'Automatic (DHCP)'. I know another option would be to turn off DHCP and set my DNS manually, but ideally would like the flexibility of DHCP and I can't see why the University DNS would be added by DHCP.
Thanks for the quick response. OK. I have followed half your instructions.
I have added to my /etc/dhcp3/dhclient.conf file the line - prepend domain-name-servers 192.168.1.1;
I did not add - supersede domain-name “mydomain.com”;
for three reasons. I dont understand what it is supposed to do, I am not sure what to put in place of “mydomain.com”, and my reading suggests that the prepend change alone should fix the problem.
It has not. My unwanted server 130.209.4.16 is still at the top of the list after a manual edit of my resolv.conf file then a reboot.
I'll likely get flamed for saying this, but you could edit /etc/resolv.conf (and set it up the way you want it) and then - if you're using an ext2/3 filesystem - run:
# chattr +i /etc/resolv.conf
The file will be immutable, and nothing will be changing it, period. That's the big hammer approach until you're able to put together a proper fix.
"check the /etc/resolvconf/run/interfaces/ directory for the vpn interface and delete it. so if your vpn interface was on "tun0" then you need to delete the "tun0" file(s)."
The tun0 file did contain the offending DNS and deleting it has fixed the problem.
Not sure what will happen when I try to install VPN again though...
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.