Persistent lease file

Hi,

I know this topic has already been discussed some time ago.
However, I don't know if things have changed since then, with stable version 21 just around the corner.

I wish I could have persistent leases (both IPv4 and v6) after reboot. This need is more related to DNS resolutions than to DHCP leases, since dnsmasq (and odhcpd ?) relies on dhcp leases to perform internal network name resolution.

My router being equipped with robust storage (msata) I am not worried about flash wear

With the default configuration (leasetime = 12h) if the router is required to restart, we may end up with hosts whose reservation first renewal (T1) will only occur in 6 hours or more and which cannot be resolved until this renewal. It's frankly annoying when that happens.

For the moment I have shortened the leasetime and declared my most common hosts IPv4 and IPv6 in the routeur's /etc/hosts but I would also appreciate not having to maintain the same information in different places unnecessarily.

Are there any good practices in this regard?
Thank you

Do you use the dns option?

1 Like

Yes I do,

config host
        option name 'station10'
        option dns '1'
        option ip '192.168.0.10'
        option duid '0001000xxxxxxxxxxxxxxxxxxxx'
        option hostid '10'
        option mac '00:xx:xx:xx:xx:27'

but it doesn't seem to be persistent across reboot

dhcp.@dnsmasq[0].leasefile='/path/to/sata/dhcp.leases'
uci commit dhcp
service dnsmasq restart
3 Likes

oops, so sorry, I just discovered a problem with my work laptop from which I have done some testing the last few days. This behaviour made me think my router had a problem

it tries to contact my dns server through one of its IPv6 address but has probably a kind of IPv6 filtering somewhere.
if I do some nslookups it can't resolve any of my lan hosts because it only tries with a 'probably filtered' DNS server's IPv6 address, even hosts with valid leases/records ... until I force nslookup to use the DNS server's IPv4 address

works fine with any other computer on my lan, just a behaviour from this work laptop

... problem solved after verifying the basics ;o)
thanks a lot trendy !

in fact there is no pb for ipv4 hosts resolution after router reboot, but still no ipv6 hosts resolution until the client's renew

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.