2

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.

MrSunday
  • 151
  • 6

1 Answers1

2

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.

Tom O'Connor
  • 27,480
  • 10
  • 73
  • 148
  • 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