[Dnsmasq-discuss] dnsmasq inotify read /etc/wireguard/hosts file but then does not update its internal records....

Matthias May matthias.may at westermo.com
Wed Nov 18 21:21:01 GMT 2020


On 18/11/2020 19:31, Jelle de Jong wrote:
> Hello everybody,
> 
> I created the following setup.
> 
> no-hosts
> hostsdir=/etc/wireguard
> 
> Nov 18 19:20:08 firewall01 dnsmasq[18828]: inotify, new or changed file
> /etc/wireguard/hosts
> Nov 18 19:20:08 firewall01 dnsmasq[18828]: read /etc/wireguard/hosts - 0
> addresses
> Nov 18 19:20:08 firewall01 dnsmasq-dhcp[18828]: not giving name
> laptop02.powercraft.lan to the DHCP lease of 192.168.40.150 because the
> name exists in /etc/wireguard with address 192.168.44.68
> Nov 18 19:20:08 firewall01 dnsmasq-dhcp[18828]: not giving name laptop02
> to the DHCP lease of 192.168.40.150 because the name exists in
> /etc/wireguard with address 192.168.44.68
> 
> I got a script running that adds and removes host records in
> /etc/wireguard/hosts depending on there availability (ping).
> 
> However dnsmasq perfectly detects the added and removed host, but then
> does not want to update its dhcp dynamic dns records because it still
> detects the host in the hostsdir, even though it just re-scanned the
> directory and found zero hosts...
> 
> root at firewall01:~# dnsmasq --version
> Dnsmasq version 2.80  Copyright (c) 2000-2018 Simon Kelley
> Compile time options: IPv6 GNU-getopt DBus i18n IDN DHCP DHCPv6 no-Lua
> TFTP conntrack ipset auth DNSSEC loop-detect inotify dumpfile
> 
> What am I doing wrong? Is this the correct behavior?
> 
> Kind regards,
> 
> Jelle de Jong
> 
> _______________________________________________
> Dnsmasq-discuss mailing list
> Dnsmasq-discuss at lists.thekelleys.org.uk
> https://urldefense.com/v3/__http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss__;!!I9LPvj3b!WUThnC6dTmklfPeXH4-iHg5zTSFvXqJiVYAnMx7eCEsKvrq_5zi2QXSbXZsxmJl8hNo$
> 

Hi
Is this perhaps on an OpenWRT based system?

Not sure if this is actually your issue, but this was something we've
run into:
On OpenWRT dnsmasq runs in a jail.
The inotify is set up for the parent folder.
In your case the file is at /etc/wireguard/hosts, thus the inotify would
be set up for /etc/wireguard
When running inside a jail, access to the entire parent folder has to be
granted, not only the file itself.

BR
Matthias



More information about the Dnsmasq-discuss mailing list