[Dnsmasq-discuss] inconsistence between dhcp-hosts and dhcp-hostsfile
Simon Kelley
simon at thekelleys.org.uk
Tue Jul 8 16:05:40 UTC 2025
Andreas,
If you can easily build dnsmasq from source, please could you try
applying the patch below, and see if that fixes the problem?
Cheers,
Simon.
diff --git a/src/dnsmasq.c b/src/dnsmasq.c
index 62a9e59..9c37e5a 100644
--- a/src/dnsmasq.c
+++ b/src/dnsmasq.c
@@ -1777,9 +1777,9 @@ void clear_cache_and_reload(time_t now)
#ifdef HAVE_DHCP
if (daemon->dhcp || daemon->doing_dhcp6)
{
+ reread_dhcp();
if (option_bool(OPT_ETHERS))
dhcp_read_ethers();
- reread_dhcp();
dhcp_update_configs(daemon->dhcp_conf);
lease_update_from_configs();
lease_update_file(now);
On 6/27/25 15:26, Andreas Kuropka via Dnsmasq-discuss wrote:
> I am using dnsmasq 2.91 un a Raspberry Pi 5 (Arch Linux Arm). To declutter my config I have moved my dhcp-hosts to a dhcp-hostsfile and found an inconsistency.
>
> While in the config a declaration such as dhcp-hosts=AA:BB:CC:DD:EE:FF,set:name still considers the settings in the system hosts/ethers-file for IP-assignment a declaration in a hostsfile of AA:BB:CC:DD:EE:FF,set:name gives the device a new IP (.42 instead of .11) and logs:
>
> Jun 27 16:05:17 raspberry dnsmasq-dhcp[419]: Name iPhone wurde dem DHCP-Lease von 192.168.188.42 nicht zugewiesen, da der Name in /etc/hosts bereits mit Adresse 192.168.188.11 existiert
>
> Aside of the IP everything works, dhcp-options defined in an optsfile are respected. This would confirm MAC-address is correct (it was also copied/pasted while transferring to new files).
>
> Adding the desired IP to the dhcp-hostsfile (AA:BB:CC:DD:EE:FF,set:name,1.2.3.4) resolves the problem but this would be a double configuration. Also, there's then a warning logged:
>
> Jun 27 16:21:28 raspberry dnsmasq-dhcp[410]: doppelte IP-Adresse 192.168.188.15 (iphone12) in "dhcp-config"-Anweisung
>
> Please have a look, thank y
>
>
> _______________________________________________
> Dnsmasq-discuss mailing list
> Dnsmasq-discuss at lists.thekelleys.org.uk
> https://lists.thekelleys.org.uk/cgi-bin/mailman/listinfo/dnsmasq-discuss
>
More information about the Dnsmasq-discuss
mailing list