mirror of
https://github.com/mageddo/dns-proxy-server.git
synced 2026-04-25 09:25:56 +03:00
[GH-ISSUE #158] OSX Compatibility #63
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#63
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 @jwundrak on GitHub (Aug 26, 2019).
Original GitHub issue: https://github.com/mageddo/dns-proxy-server/issues/158
What is expected
Support OSX
Currently per default you can not access container with their IPs directly on OSX. There are some workarounds and for me the best working thing is https://github.com/AlmirKadric-Published/docker-tuntap-osx . Using this (after setup the routing), I can ping and
dig/nslookupdirectly to DPSWhat is Happening
An issue for me is, that the DPS overwrites all *.docker.internal DNS entries, that also used on windows. That are e.g. host.docker.internal or gateway.docker.internal
There is a pull-request, to add this also to linux to provide an "same behaviour on all OSes": https://github.com/docker/libnetwork/pull/2348 . Hopefully it is merged in the next months.
Cause of the Docker-for-Mac (DfM) implementation, all others containers can not reach the dns, if I add the volume mapping to
/etc/resolv.conf, so all builds fails (DNS e.g. forapt update) and so on...Changes
I tried this locally and think, that this should work:
resolv.confWhat I expect:
Mapping the dns-proxy to localhost:53 (localhost = host), populate in the resolv.conf as host.docker.internal (resolved to ip).
@mageddo commented on GitHub (Aug 27, 2019):
@jwundrak Thanks for the very detailed report
@mageddo commented on GitHub (Aug 27, 2019):
What's supposed to ignore this entries and forward them to docker daemon?
Do you wanna to parameterize which DNS server IP should be written to resolv.conf
@mageddo commented on GitHub (Aug 27, 2019):
Okay,
Can you elaborate which is your use case?
DPS will not be useful for the host machine in this case since overlay network is only accessible by the containers connected to it, any swarm container solved IP will not be accessible from the host machine due network scope limitations and bridge networks are not allowed in swarm stack services
The only useful DPS features probably will be cname , the local store entries and the remote proxy DNS.
@jwundrak commented on GitHub (Aug 27, 2019):
@mageddo Thanks for the fast response
The use case is, that we have some developer machines, that should be available on the host machine. eg
mydev.docker. On Linux this works pretty well, but on OSX not. (Windows I don't known, but there is a documentation for that, I think this also works).What I want is, that we add in the resolv.conf the gateway.docker.internal (for me this is 192.168.65.1). If I map the port 53 from DPS to the "localhost", than all containers can access them. Now it is in its own network like 172.17.20.0/24 and on build 172.17.21.0/24 can not resolve any dns queries.
I think, do allow some ip is not pretty well. Maybe we can make a os switch inside your code or an option like: auto-os or something (For me: we want the dev-ENV on OSX/Linux/Win)
How i can ignore them? I added host.* and gateway.* as predefined entries in the config. On OSX per default all containers use as NS the IP of gateway.docker.internal, which is for me 192.168.65.1. The best, I think, is to resolve everything from docker.internal to this IP. Should be possible or?!
@jwundrak commented on GitHub (Sep 2, 2019):
@mageddo Got you any time, to what at this?
With binding *:53 to "localhost" and avoid mapping of the resolv.conf, it is run fine for me, but i have to add
host.docker.internalandgateway.docker.internalas preconfigured values in theconfig.json.@TheKnightCoder commented on GitHub (Oct 29, 2019):
Any progress with this? would love this feature
Also a detailed instructions of the workaround could be useful
@mageddo commented on GitHub (Nov 12, 2019):
@TheKnightCoder I'm trying to figure out yet exactly must be did to get DPS working on Mac yet.
@jwundrak
So if you
config.jsonlike attach 1/etc/resolv.confon host machine like attach 3Then you get DPS fully working?
Attach 3
Attach 2
Attach 1
@gchari-asapp commented on GitHub (Aug 4, 2020):
I tried and it is not working.
I made a couple of corrections still.
The docker run must specify the port as udp
53:53/udp. In addition the current command mountsconfig.jsonas a directory. It thus needs to be$(pwd)/config.json:.... Finally, at leastmacos 10.14does not use resolv.conf. To add the localhost as a nameserver I run the following command:sudo networksetup -setdnsservers Wi-Fi 127.0.0.1.After this corrections DPS starts logging requests. However the resolution is failing.
@mageddo commented on GitHub (Mar 4, 2023):
I think you get close @gchari-asapp , probably
networksetup -setdnsservers Wi-Fiwill work correctly only when specifying a IP which isn't a loopback address, need to specify your network interface IP, something like '192.168.0.x'.@mageddo commented on GitHub (Mar 4, 2023):
I'm finally with access to a MacBook so I did some tests using DPS 3.7.0, my conclusion is it's now working the best it can on Mac due Docker for Mac limitations, can you confirm that or am I missing some feature? Got the following results after ran the steps below:
A nginx container:
Running a container to make some tests
@mageddo commented on GitHub (Mar 4, 2023):
Checkout running it docs for Mac (actually nothing special for Mac, just some hints)
@mageddo commented on GitHub (Mar 4, 2023):
This is a duplication of #44