-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dnsmasq binds to all interfaces even if you specify a listen interface #491
Comments
OK, I seem to have successfully worked around this issue. I created a /etc/dnsmasq.d/99-mysettings.conf and put "bind-interfaces" in there. Now dnsmasq is only binding to localhost and the interface I specified. For the second pihole container instance I disabled host networking and I can now directly forward port 53 from inside the container to the separate interface that the first instance of pihole is no longer binding to. I'll leave this active in case someone wants to add support for enabling "bind-interfaces" via a docker container environment variable. Otherwise feel free to close this out. |
@dprus thank you for the insight, any chance you can share the dnsmasq file with us? I'm having the same problem (I think) |
I've got something which works.. My host, a raspberrypi, has two ip addresses docker-compose.yml
/etc/etc-dnsmasq.d/98-pihole.conf
/etc/etc-dnsmasq.d/99-pihole.conf
|
I'm also experiencing this issue running docker-pi-hole in balena. I second the proposal for a DNSMASQ_BIND_INTERFACES environment variable. I will attempt to use this fix in the meantime! |
This issue is stale because it has been open 30 days with no activity. Please comment or update this issue or it will be closed in 5 days. |
dnsmasq will bind to all interfaces on port 53 even if you specify an interface for it to bind to. This is normal behavior. In order for dnsmasq to bind only to specified interfaces you need to use the bind-interfaces directive in the config.
I am planning on running two separate instances of pihole on my server (each one bound to a different interface) but this is not possible because there does not seem to be a way to set the bind-interfaces directive for pihole docker containers via environment variables.
My ask below is firstly for a feature that allows us to set the bind-interfaces directive via an environment variable. And, secondly, is there a good workaround for this that I can employ while I wait for the feature?
This is a...
Description
I can't think of more detail than what I put above.
Expected Behavior
N/A since the feature doesn't exist yet.
Actual Behavior
N/A since the feature doesn't exist yet.
Possible Fix
Add a new environment variable like DNSMASQ_BIND_INTERFACES and then set the value of that environment variable in 01-pihole.conf (bind-interfaces=value).
Steps to Reproduce and debugging done
Really easy to reproduce:
You will see that your container is bound to 0.0.0.0 and :::
Debug steps I have tried
docker run
example in the readme (removing any customizations I added)Context and extra information
I want to run two separate pihole instances on two separate interfaces on my server.
The first (primary) instance will host dhcp (the second will not). The second pihole instance will use conditional forwarding to point to the first pihole instance's dns server for local dns resolution.
This will allow me to have most of my home network point to one set of upstream dns servers while a few machines on my network can point to a different set of upstream dns servers. I can also have different pihole whitelists, etc. for different parts of my home network.
This will allow me to have a very restricted network for my kids whilst having a less restricted setup for myself.
Your Environment
The text was updated successfully, but these errors were encountered: