Re: dnsmasq integration?



Hi!

> Hm.  I'm looking through lots of NetworkManager pages/docs and the GIT
> repositories, and I see that there has been something titled "Local
> caching nameserver support using dnsmasq" added in 0.8.2.

Interesting. I'm using Ubuntu LTS so I'm not at the leading edge with
nm, I guess it's 0.8.

However, I have been running dnsmasq for a while (mainly to act as
DHCP and DNS server for virtual machines I'm hosting on local network
interface).

On Ubuntu Lucid I solved the dnsmasq - nm integration as follows:

- dnsmasq is configured to read upstream DNS servers from /etc/resolv.conf1

- nm is patched to write to /etc/resolv.conf1 instead of /etc/resolv.conf
  (I'm willing to share the patch if anybody is interested. I haven't
  done so, because it's not 100% perfect, see below) 

- /etc/resolve.conf is manually edited to contain 127.0.0.1. It will never
  be changed (*)


(*) actually this is not true: pppd overwrites it every time. But this is
an office machine and I use pppd only 1-2 times a year when the network is
down, so I have not thought about fixing this. But it means that my solution
is not suitable for people using dial-up regularly.


On OpenSUSE 11.3 (I guess nm 0.8, too) this approach did not work,
because network manager does not write /etc/resolv.conf. I'm not so
familiar with OpenSUSE netconfig, but I have dnsmasq working together
with nm without any patches. Maybe I needed a one time configuration
change or netconfig did it for me, I don't recall. It works very
reliably. It's actually a laptop and I use it regularly on very
different networks (cable, WiFi and cellular), but dnsmasq - nm has
never caused any trouble.

In /etc/resolv.conf the first one is 127.0.0.1, i.e. dnsmasq, but
dnsmasq knows to ignore that one. Additional ones are put there
by nm / netconfig each time a new connection is established and dnsmasq
uses them as upstream servers.


Regards,

Uwe


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]