Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have an Ubuntu 10.10 guest os on VMWare workstation with two network interfaces. One of the interfaces is bridged with the physical interface and uses dhcp. The other is host-only and uses a static IP. I have set up /etc/interfaces to look like this:

//lo def here

auto eth0
iface eth0 inet dhcp

auto eth1
iface eth1 inet static
address 192.168.79.128
gateway 192.168.79.1
netmask 255.255.255.0

and /etc/resolv.conf:

nameserver 192.168.3.5
nameserver 192.168.3.50
domain host.com
search host.com

Now it works for a little while and then dhclient (i think) overwrites resolv.conf and sets a single nameserver, 192.168.79.1. I've killed nm-applet, so I know it's not that POS getting in the way. I've also tried editing /etc/dhcp3/dhclient.conf, but to no avail:

supersede domain-name-servers 192.168.3.5,192.168.3.50

I've done some googling, but have found no viable solutions. Has anyone come up with a solution to this issue?

share|improve this question
    
Hi its network manager that is rewriting your resolv.conf. If you can live without network manager then I'd suggest to remove it, although there are a number of ways to get round it one is to make resolv.conf read only (after editing) although im sure there are much better ways to do it so ill leave this is comment. –  Shutupsquare Jul 27 '11 at 16:23
    
I killed the nm-applet process using kill -9 instead of gracefully stopping the process with service. Perhaps there was another process associated with network-manager changing it. Testing right now, will keep you updated. –  krs1 Jul 27 '11 at 16:51
    
You need to run sudo stop network-manager I think not a 100% that nm-applet is just part of the GUI frontend so killing that may not kill the part rewriting ur resolv.conf, you can try killall networkmanager. –  Shutupsquare Jul 27 '11 at 18:30
    
Thanks, completely removing network-manager solved my problem. Also, chattr +i /etc/resolv.conf works, but I prefer to discard network manager altogether. Also, I need to remove the default gateway for the host-only interface. Post your solution under answers, it works just fine. –  krs1 Jul 27 '11 at 19:39

1 Answer 1

up vote 1 down vote accepted

Hi its network manager that is rewriting your resolv.conf. If you can live without network manager then I'd suggest to remove it, another way would be to make resolv.conf read only (after editing)

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.