mirror of
https://github.com/mageddo/dns-proxy-server.git
synced 2026-04-25 09:25:56 +03:00
[GH-ISSUE #347] Running in a container with DPS_NETWORK feature not working as expected #124
Labels
No labels
bug
confirmed
discussion
duplicate
enhancement
feature
feature-request
not-planned
pull-request
secondary-feature
stale
triage
waiting-feedback
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/dns-proxy-server-mageddo#124
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Sajito on GitHub (Mar 8, 2023).
Original GitHub issue: https://github.com/mageddo/dns-proxy-server/issues/347
Really cool to see this project being actively developed again.
What is Happening
I'm running the dns server in a docker container and want to use the DPS_NETWORK feature. This is my
docker-compose.yml.When the container is started, the dns server is started listening on the container ip address and the container localhost ip address. Then the server connects it's own container to the dps network. Finally it writes the ip address from the dps network to the resolv.conf.
But because the server is not listening on the dps interface, the dns is not reachable. Have a look at this screenshot. If i'd use the initial ip address as dns server, then everything would be fine.
What is expected
Simply said, I'd only expect the automatic configuration to work. I can think of multiple ways to solve this.
Specs
/app/dns-proxy-server --versionresults in an error (Unmatched argument at index 0: '/app/dns-proxy-server'), but I've specified version 3.8.1 in my docker-compose.yml@mageddo commented on GitHub (Mar 12, 2023):
Hey, thanks, you are are helping a lot here.
Yep the command to retrieve the version on docker image changed, I'm updating the docs right now
@mageddo commented on GitHub (Mar 12, 2023):
DPS is designed to prefer DPS network in all senses when it's available, it works great, I think the root cause here is DPS find
172.157.5.0, 0 is not a valid IP address, will take a look to find out what is hapenning.@Sajito commented on GitHub (Mar 12, 2023):
When I first saw the IP address ending on
.0I thought the same, but everything worked fine using the IP address. I can use the IP address for anything, even the API of the GUI.I searched a bit and found this thread on serverfault (https://serverfault.com/questions/10985/is-x-y-z-0-a-valid-ip-address).
Having an IP address ending on
.0seems to be perfectly fine, depending on the subnet. The createddpsnetwork is a172.157.0.0/16subnet. So from my understanding the IP address172.157.5.0should be perfectly fine, as it is for most software involved.I'm not sure, because I didn't really debug it, but I think the problem is not the IP address. I think the problem here is that the dns server is started before the dps network is created and the container attached.
If I create the dps network manually and attach the container to that network by myself, then the server will start listening on the
172.157.5.0address. Unfortunately if I do that, then it'll again write a wrong ip address in the resolv.conf file.Would there be any problems, if the udp and tcp servers were started listening on all interfaces (0.0.0.0), instead of only on specific, detected ip addresses?
@mageddo commented on GitHub (Mar 12, 2023):
I think this must be the issue...
Containers won't be able to solve each other because docker won't be able to use this address as a valid DNS server, the container solving will only work at the host.
Despite on this, some feature to choose which interface to use for the OS configuration can be elaborated in the future
@mageddo commented on GitHub (Mar 12, 2023):
For now, you can disable defaultDns and set 127.0.0.1 or something like at your
/etc/systemd/resolved.confthen runservice systemd-resolved restartand run DPS as a docker service.See configuring systemd-resolved
@mageddo commented on GitHub (Mar 12, 2023):
Just letting you know
MG_RESOLVCONF: /host/etc/resolv.confis not necessary anymore, see https://github.com/mageddo/dns-proxy-server/pull/323@mageddo commented on GitHub (Mar 17, 2023):
just relesed 2.12.1, can you give it try @Sajito ?
@Sajito commented on GitHub (Mar 17, 2023):
Working fine, thank you!