Pihole docker reload dnsmasq

Please follow the below template, it will help us to help you!

Hey all, I’m running pihole within docker:

Have all the necessary volume mounts etc to edit dnsmasq configuration.
However I cannot find how dnsmasq is set up as a service; the usual suspects don’t exist within the docker image (systemctl, service, etc)

I do see it is probably init.d based, but I don’t see dnsmasq in there

/etc/init.d# ls
cron dhcpd hwclock.sh lighttpd networking pihole-FTL procps resonvconf sudo

Expected Behaviour:

Documentation for dnsmasq configuration changes and how to reload without restarting the entire docker.

Probably in https://github.com/pi-hole/docker-pi-hole#customizations ?

Actual Behaviour:

Once the user has made changes, to some customization services (such as dnsmasq) it would be useful to know how to reload said changes w/out having to restart the entire docker container.

Debug Token:

https://tricorder.pi-hole.net/kpt95moxby

dnsmasq is embedded in pihole-FTL and does not run as a separate process.

So service pihole-FTL restart ?
(reload doesn’t exist)

EDIT: tried it, and it doesn’t seem to take effect the config changes in dnsmasq
(specifically I added a new /etc/hosts.local file, and ref to it from dnsmasq.d/02-mydns.conf containing addn-hosts=/etc/hosts.local)

I’m not familiar enough with Docker to guide you on Docker settings.

On bare metal, pihole-FTL uses the same configuration files as dnsmasq, since it contains dnsmasq. Local host mapping can be done in /etc/dnsmasq.d/99-hosts.conf , as an example filename. The filename should not duplicate any of the existing Pi-hole created files, nor should the Pi-hole files be modified.

seems like pihole-FTL isn’t honoring dnsmasq config files

:/etc$ cat hosts.local
1.0.0.60 pihole
:/etc$ cat dnsmasq.d/02-mydns.conf 
addn-hosts=/etc/hosts.local

even after a fresh startup i don’t see the logs sucking that in

got it, the addn-hosts directive isn’t working
but the address one does ;/ oh well

This should have worked - maybe a permission issue with /etc/hosts.local.
But for only a single hostname association (as you seem in want to apply), an address option will do just as well, as would an entry in /etc/hosts. Note the latter would take precedence with competing definitions.

From within the container, that could be achieved by

 pihole restartdns

The same could be triggered through Pi-hole’s Settings pane by clicking Restart DNS resolver.

Does this solve your problem, or are you trying to find a way how to trigger a DNS service restart programmatically from outside the container?

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