Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

On system start, /var/run/dnsmasq/resolv.conf file ends up being blank. I had expected the resolvconf package to update it with the info from /etc/network/interfaces (dns-nameservers, dns-search).

I'm running a Ubuntu 10.04.2 LTS lucid server. I have both resolvconf and dnsmasq installed.

Here's the interfaces file section for eth0 (changed ip and dns names):

auto eth0
iface eth0 inet static
    address 10.100.1.100
    netmask 255.255.255.0
    network 10.100.1.0
    broadcast 10.100.1.255
    gateway 10.100.1.1
    dns-nameservers 10.100.2.2 10.100.3.2
    dns-search my-domain.com mydomain.com

If I run ifdown eth0 && ifup eth0 after start up, then the /var/run/dnsmasq/resolv.conf file is correctly populated.

share|improve this question
add comment

1 Answer

I hate this. I found the same problem on my system. Part of the problem I think is NetworkManager (NetworkMangler).

I did the following

echo "nameserver 8.8.8.8" > /etc/resolv.conf
echo "nameserver 8.8.4.4" >> /etc/resolv.conf
chattr +i /etc/resolv.conf

Now nothing can change it but me. Doesn't solve the root problem, but certainly worked.

N.B. You can replace /etc/resolv.conf with /var/run/dnsmasq/resolv.conf

Set it, and forget it. On servers, I don't approve of services fiddling with my config. Especially if I've set up a static IP.

I wanna be in control, damnit.

share|improve this answer
    
Thanks for the idea, I'm sure this would work. I don't use NetworkManager on this server. It does seem like possibly resolvconf is initializing before the networking side is up. i'd prefer to keep the system configuration as automatic as possible, but if I can't figure out how to fix the issue, I will go along with hard coding the info in the config files. –  MrSunday Aug 15 '11 at 12:48
add comment

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.