[Dnsmasq-discuss] Serial loosed after restart

Simon Kelley simon at thekelleys.org.uk
Thu Sep 25 21:48:27 BST 2014


On 25/09/14 10:39, Christian Ruppert wrote:
> Hey Guys,
> 
> I use the auth-zone, auth-sec, auth-peer features and I noticed that dnsmasq
> looses its actual SOA resp. serial during restarts and thus it started again
> from the beginning (1). All slaves were rejecting the changes because of that
> serial mismatch. E.g. the slaves all had "34286" and dnsmasq started from "1" again.
> It would be really good to save the serial in the lease file or somewhere else
> and re-use it afterwards to avoid such problems. Is that a bug or was it on purpose?
> 

It's supposed to work like this:

The serial number starts as the time (seconds since 1970) when dnsmasq
is started. Therefore stopping and restarting dnsmasq should _increase_
the serial.

My guess is that you're using a platform which doesn't have a hardware
real-time-clock, and so it's idea of the time gets reset whenever it's
rebooted. Even if it uses NTP to get a good value of the time, this will
happen after dnsmasq has started.


You can set the initial serial number when starting dnsmasq using the
command-line argument (or config option.)

--auth-soa=<serial number>

so you could implement something like the behaviour you want by keeping
the serial in a file, incrementing it each time dnsmasq starts, and
feeding it to dnsmasq via the command line. Shell scripting to do this
left as an excercise....


Cheers,

Simon.






More information about the Dnsmasq-discuss mailing list