Please follow the below template, it will help us to help you!
Expected Behaviour:
Before the upgrade to v6 I used to set static ip addresses in an dnsmasq config file under /etc/dnsmasq.d/15-static-dhcp.conf containing dhcp-host lines like this dhcp-host=aa:bb:cc:dd:ee:ff,100.100.55.3,fileserver4.my.domain.de,infinite
When changing settings I used to do:
dnsmasq --test
pihole restartdns
This is no longer recognised because dnsmasq is no longer used (if I got this right)
Hardware: Raspberry Pi 5
Software: Rasbian
Actual Behaviour:
Guess I am asking if I can replicate this behaviour in a similar way.
Where is the list under "Static DHCP configuration" in the interface saved?
pihole.toml in hosts = [ ] ?
Is the field checked before it is deployed?
What I am missing in this field is the possibility to comment. is that possible?
dnsmasq was replaced by pihole-FTL with Pi-hole v4 in 2018.
Pi-hole v4 and v5 continued to store and read configuration options at /etc/dnsmasq.d/.
This may have created conflicts, e.g. in rare cases when users required to run an additional dnsmasq instance next to Pi-hole.
Pi-hole v6 avoids those potential conflicts by storing and reading information from /etc/pihole/.
As above is calling the dnsmasq executable, that only may have worked if dnsmasq had been installed next to Pi-hole.
For both v5 and v6, you'd have to invoke that via pihole-FTL instead:
pihole-FTL dnsmasq-test
If required, you can configure Pi-hole to still include configuration information as read from /etc/dnsmasq.d/, as yubiuser has explained above.
In your specific case, you may consider to just use Pi-hole v6's Static DHCP configuration:
As you may have guessed already, the part after dhcp-host is exactly the format as accepted by Pi-hole's Static DHCP configuration.
Lines in that field would accept trailing comments, and if Pi-hole's DHCP server is active, they are validated when you hit Save&Apply.
Under All settings - Misc - misc.dnsmasq_lines you can add dhcp-hostsfile=/etc/pihole/dhcp_reservations.list
or whatever file you want.
This file contains same lines as before in the dnsmasq conf-file, but without dhcp-host= at the beginning
@roedert Thank you. This is exactly what is asked for.
DNSMASQ manpage confirms that it is re-read without a restart of the service.
-dhcp-hostsfile=
Read DHCP host information from the specified file. If a directory is given, then read all the files contained in that directory in alphabetical order. The file contains information about one host per line. The format of a line is the same as text to the right of '=' in --dhcp-host. The advantage of storing DHCP host information in this file is that it can be changed without re-starting dnsmasq: the file will be re-read when dnsmasq receives SIGHUP
So I can change the file /etc/pihole/dhcp_reservations.list, than pihole-FTL dnsmasq-test and than pihole reloadlists.