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

Re: DNS for small network with internet connection



It was to solve exactly this sort of problem that I created the
resolvconf package.  With resolvconf installed, DHCP clients
send their information to resolvconf; resolvconf then generates
a /etc/resolv.conf file for applications to use, and a separate
/var/run/dnsmasq/resolv.conf file for dnsmasq to use.

Thus, in your case, with resolvconf installed, the /etc/resolv.conf
file will contain:

    nameserver 127.0.0.1
    nameserver 1.2.3.4
    nameserver 5.6.7.8

(the first line supplied by dnsmasq, the other two by dhclient)
whereas the /var/run/dnsmasq/resolv.conf file will contain:

    nameserver 1.2.3.4
    nameserver 5.6.7.8

For this to work without your having to do manual configuration,
get the latest versions of dhcp3-client and dnsmasq and make
sure you haven't changed their configuration files such that the
integration with resolvconf is disabled.

Resolvconf isn't absolutely necessary, given that various packages
have implemented their own kludgy solutions to these problems.
(Dhclient has its option modifiers and dnsmasq can monitor several
resolv.conf files.)  However, it is nice in that it solves the
problem of contention over the resolv.conf file quite generally,
centrally and flexibly.  Resolvconf also provides hooks so that
applications can arrange to be notified when the resolver 
configuration changes.

You can get the latest resolvconf deb from the resolvconf section
of the update-resolv project at alioth:

    http://alioth.debian.org/projects/update-resolv

Read the README file for more information.  Please let me know
if you run into any problems.

On Fri, Jul 11, 2003 at 07:53:33PM +0200, David Fokkema wrote:
> Currently, I use dhcp and dnsmasq to serve my local LAN. Very, very
> easy to set up and it works as a charm. I use dhcp-client to acquire
> an IP addres for the internet, which then rewrites /etc/resolv.conf to
> incorporate the name servers for the internet.
> 
> My problem is that my server has no idea what the internal LAN is all
> about: its nameservers are the ones provided by my ISP. If I add my
> local dns server (dnsmasq) to /etc/resolv.conf, it is overwritten the
> next time the lease is renewed. Telling dhclient.conf to _not_ write
> to /etc/resolv.conf will not update my nameservers for the internet,
> so there must be another way, I think.

Dag
--
Thomas Hood



Reply to: