Even after lots of tests and research in documentation and forums I'm stuck. Any advice welcome.
These are the facts:
- I want to run pi-hole via a container (docker-compose.yml defined) on my NAS. Version is the latest v6.
- Besides DNS I also need DHCP, I don't have and want a proxy like Caddy, which according to pi-hole documentation means that I have to use network-mode: host
- If I use network-mode host, I cannot use the docker port-mapping feature.
- I have already some other services on the NAS running in containers. I don't want those to interfere (especially port-conflicts), so I decided to add a new alias IP on the main internal network interface of the server. This IP is dedicated to pi-hole only.
- According to my research in docs and forums, I configured this specific IP in the following ways:
- docker-compose env-variables:
- FTLCONF_LOCAL_IPV4: '192.168.0.25'
- FTLCONF_misc_etc_dnsmasq_d: 'true'
- './etc-dnsmasq.d:/etc/dnsmasq.d' (for persisting custom dnsmasq configs)
- in a custom dnsmasq.conf-file dnsmasq.d/fractal.conf:
- bind-interfaces
- listen-address=192.168.0.25
- in a custom lighttp config file lighttp/external.conf
- server.bind = "192.168.0.25"
When I start the container, DNS and DHCP works fine. However, if i test DNS-resolution against the different IPs of the server, it works with all of them! So binding to a specific IP didn't succeed. I could live with that.
The GUI however is not accessible. When I connect to the shell of the container, I see that binding to the given IP (with all those config steps above) didn't succeed.
netstat gives many lines like:
tcp 0 0 pi.hole:http 0.0.0.0:* LISTEN
tcp 0 0 pi.hole:http 0.0.0.0:* LISTEN
..which tells me binding didn't work at all.
BTW, in my different in one point (before going the alias way) I tried to use the docker environment-variable WEB_PORT, which according to some discussions should have worked to pick a dedicated port for the Web-GUI (as 80/443 is in use on my server for the other IPs). But that didn't work neither.
Could it be that v6 brought some changes concerning the IP binding process?