[Dnsmasq-discuss] setting up dynamic DNS?

Jan 'RedBully' Seiffert redbully at cc.fh-luh.de
Sun Sep 9 16:10:49 BST 2007

Adam Hardy wrote:
> Hi DNSmasq List
> I have a small network with a slightly different setup for the internet
> broadband from usual. I'm having problems working out how to set up a
> DHCP service with dnsmasq to provide workstations with permanent host
> names.
> Instead of the usual router providing DHCP and DNS services, I just have
> a simple DSL modem attached to eth2 on my gateway server (isengard).
> Using dhclient3, isengard grabs itself a public ip for eth2 via DHCP on
> the modem.

Thats IMHO a typical setup, i also just use a dsl modem and a full-blown
linux box as router, because the config capabilities of those
router-in-a-box won't cut my needs (multihomed router, fancy traffic
shaping, some servers, etc.).

> isengard also runs dnsmasq on eth1 for the internal network, and I run
> iptables as my firewall to protect it. I gave eth1 the IP
> I've reached the point where dnsmasq tells every client to use
> as the nameserver. These clients run dhclient3 (and windows
> and the mac are happy too)
> But this naive approach obviously doesn't cut the mustard. Can I
> instruct dnsmasq to be nameserver of all my hosts for each other?

> isengard /etc/dnsmasq.conf:
> domain-needed
> bogus-priv
> filterwin2k
> dhcp-range=,,12h

If this is your complete dnsmasq.conf, you will need some more entries.

First, you need to set some dhcp-options, the client needs to requst
(but normaly does if everthing is set to "recive stuff over dhcp")

dhcp-option=1, # subnet mask
dhcp-option=3, # default gateway
dhcp-option=6, # dns-server denotes the IP dnsmasq is listening to (in your case
When your Samba comes in to play, you maybe also want
dhcp-option=44, # set WINS

Didn't you recieve a dnsmasq example config file?
(/usr/share/doc/dnsmasq* ?)

Second, to assign some hosts a permanent IP-address, even if recieved by
dhcp, you need some dchp-host lines

You may want to shorten your dynamic range to make room for those static

As soon as this lease is given to the client, you should be able to ping
it by name (if you have isengard as dns-server in your resolv.conf), and
if its switched off (lease returned) you should get 'host unknown' (this
is the nice part of dnsmasq beeing both, dns and dhcp server).

Finaly you may want to split the resolv.conf for the machine isengard,
and the dns servers dnsmasq uses (upstream).
Since i have to use PPPoE, i changed the DSL-Scripts not to overwrite
/etc/resolv.conf and said my dnsmasq to use the resolv.conf always
generated by pppd:

and then set /etc/resolv.conf to

But how to achive this depends on the way you connect to upstream.


> Thanks and regards
> Adam Hardy


Ever notice how fast Windows runs? Neither did I.

More information about the Dnsmasq-discuss mailing list