LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 01-11-2009, 02:22 PM   #1
MonkeyMagic23
LQ Newbie
 
Registered: Jan 2009
Posts: 3

Rep: Reputation: 0
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.

Someone help me....
 
Old 01-11-2009, 03:06 PM   #2
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Slackware current
Posts: 8,457

Rep: Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874
as root edit
/etc/dhcp3/dhclient.conf

Edit the following two lines to read as

supersede domain-name “mydomain.com”;
prepend domain-name-servers 192.168.1.1
 
Old 01-11-2009, 07:24 PM   #3
MonkeyMagic23
LQ Newbie
 
Registered: Jan 2009
Posts: 3

Original Poster
Rep: Reputation: 0
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.

What now?
 
Old 01-11-2009, 08:27 PM   #4
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Debian, FreeBSD
Posts: 3,739
Blog Entries: 5

Rep: Reputation: Disabled
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.
 
Old 01-18-2009, 09:05 AM   #5
MonkeyMagic23
LQ Newbie
 
Registered: Jan 2009
Posts: 3

Original Poster
Rep: Reputation: 0
Fixed - for now.

Got this advice over on ubuntuforums.otg -
"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...
 
  


Reply

Tags
dns, resolvconf, vpn


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Mandriva: Why is /etc/resolv.conf overwritten at boot? fc6_user Linux - Networking 12 05-17-2007 06:59 PM
/etc/resolv.conf being overwritten... detpenguin Slackware 4 04-12-2005 01:42 PM
Resolv.conf Overwritten jlcarmic Debian 2 05-27-2004 08:14 AM
resolv.conf overwritten on boot cjpsparks Linux - Networking 1 11-06-2003 02:06 AM
resolv.conf overwritten LocHolmez Linux - Networking 2 09-22-2003 09:51 AM


All times are GMT -5. The time now is 10:57 PM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration