[Dnsmasq-discuss] Domain not applied correctly when reading DHCP lease file

xeyrion at gmail.com xeyrion at gmail.com
Fri Nov 24 01:34:53 UTC 2023


I have the following config:

dhcp-fqdn
domain=example.com
domain=eth1.example.com,eth1
dhcp-range=10.0.1.100,10.0.1.200

eth1 is 10.0.1.1/24.

When a client, e.g. host1, makes a DHCP request on eth1, it is
correctly assigned host1.eth1.example.com as its FQDN. Lease file is
written correctly, and DNS resolution works as expected.

However, after dnsmasq is restarted, IP assignment is read correctly
from the lease file, but FQDN now becomes host1.example.com, which is
obviously wrong. The original host1.eth1.example.com FQDN does not
resolve anymore. The problem persists until the client renews its DHCP
lease.

If I use address range in config file instead of interface name
("domain=eth1.example.com,10.0.1.0/24"), the problem does not occur.
FQDN is preserved correctly on restart.

Doing some cursory debugging, the problem appears to be here:
https://thekelleys.org.uk/gitweb/?p=dnsmasq.git;a=blob;f=src/domain.c;h=ca3931de13d74db0efdaf4f49a0d0187026d602b;hb=HEAD#l236
. "c->al" is empty at the time lease file is being read, so no domains
match, and default domain gets incorrectly assigned.



More information about the Dnsmasq-discuss mailing list