[Dnsmasq-discuss] dnsmasq.leases

Simon Kelley simon at thekelleys.org.uk
Sun Jan 31 20:54:03 GMT 2010


Adam Hardy wrote:
> Simon Kelley on 31/01/10 09:57, wrote:
>> Adam Hardy wrote:
>>> I have a new print server which gets its ip via dhcp from dnsmasq, and 
>>> it is duly registered in dnsmasq.leases.
>>>
>>> However about 1/2 hour to an hour later, the dnsmasq.leases entry for 
>>> it vanished. I can't ping it via its hostname anymore but I can ping 
>>> it via its ip address that it got from dnsmasq.
>>>
>>> It sounds to me as if the print server is acting strangely but could 
>>> there be something in dnsmasq that is causing this problem?
>> I've come across devices like this that just don't do lease renewal. 
>> They get a DHCP lease for whatever time the server gives them, but don't 
>> actually renew it. When the lease-time expires, the hostname disappears.
>>
>> The fix is to tell the dnsmasq DHCP server to give that device an 
>> infinite lease.
>>
>> dhcp-host=<MAC address>,infinite
>>
>> should do the trick.
> 
> OK, that certainly sorts it out - over an hour and dnsmasq.leases still has the 
> entry for it.
> 
> I still thought I'd better check a couple of things. Here's a decommented 
> version of my dnsmasq.conf:
> 
> domain-needed
> bogus-priv
> filterwin2k
> server=/localdomain/127.0.0.1
> local=/localdomain/
> expand-hosts
> domain=localdomain
> dhcp-range=192.168.0.3,192.168.0.254
> dhcp-option=option:router,192.168.0.2
> dhcp-option=option:mtu,1500
> 
> 
> I leave the lease duration at default - or at least I haven't set it. Here are 
> the permissions on dnsmasq.leases:

The default is one hour, so that seems to fit.
> 
> adam at isengard:~$ ls -la /var/lib/misc/dnsmasq.leases
> -rw-r--r-- 1 root root 66 2010-01-31 11:58 /var/lib/misc/dnsmasq.leases

Fine. Note that overwriting dnsmasq.leases won't affect dnsmasq 'till it
is restarted anyway - the file is normally write-only with dnsmasq using
an internal copy. The file is only read a start-up.
> 
> Does that look ok?

It looks fine.
> 
> I can't think that anything would have spoofed a DHCPRELEASE or would have 
> overwritten dnsmasq.leases - I figure the likelihood of that ever happening on 
> my lan would be only ever real if somebody had hacked into the lan and I don't 
> think that's happened with the firewall and the WEP wireless lan.
> 

I think broken print-server firmware is much more likely



Cheers,

Simon.

> 
> Regards
> Adam
> 
> _______________________________________________
> Dnsmasq-discuss mailing list
> Dnsmasq-discuss at lists.thekelleys.org.uk
> http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
> 




More information about the Dnsmasq-discuss mailing list