mirror of
https://github.com/mageddo/dns-proxy-server.git
synced 2026-04-25 17:35:54 +03:00
[GH-ISSUE #44] Does not work when using on OSX #18
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#18
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 @XaeroDegreaz on GitHub (Oct 14, 2017).
Original GitHub issue: https://github.com/mageddo/dns-proxy-server/issues/44
The
resolv.confis not used for DNS resolution on OSX.I haven't found a way to get this working :(
Edit: nevermind -- The requirements on the readme show linux.
@mageddo commented on GitHub (Oct 14, 2017):
@XaeroDegreaz Yep, it was designed to work with linux, anyway I think that's totally possible to get it working with OSX, I think DNS Proxy Server just don't know how to set as your default DNS, the main problem is that I have not a MAC, if you are interested we can work the it working.
Give a try
Run it using docker
Let's see if it is working
If it is ok, now let's set is as your default DNS, this answer says that you can do it simply putting the DNS server IP in Network Settings, you can get the DNS Server IP by running the follow command:
If it works please let me know, maybe DNS Server already works for MAC :) .
@lbustelo commented on GitHub (Nov 9, 2017):
Did it work?
@XaeroDegreaz commented on GitHub (Nov 9, 2017):
When I tried initially, I already set the DNS to the address of the proxy server, but it didn't work. However, I think it may have been because I was on my company's VPN which kind of locks down all DNS modification. It may work off of the VPN, but I haven't actually tried. Sorry, the project I was working on I ended up resolving my issue another way.
@mageddo commented on GitHub (Feb 1, 2018):
Thanks for your feedback, let's try to solve it.
Run the script bellow and hang the terminal is a expected behavior, if you want to run it in background please use docker
-doptionThat's why DNS-PROXY-SERVER is not your default dns server because I don't know how to do that in OSX, then we must to set it as default manually. We need to find out how to set dns-proxy-server as the default dns. Looking at the logs, it registered the containers as expected
Can you try run nslookup (you can also use dig) to solve the hostnames from host and give me the output? See that the command bellow will for to use dns-proxy-server as the DNS but just to this command, this way we can see if dns-proxy-server is working internally
@BR0kEN- commented on GitHub (Mar 18, 2018):
What I did to try getting it working:
But unfortunately got nothing:
@mageddo, did I do something incorrectly?
Edit: here is an article that explains how to manage DNS server from CLI - http://osxdaily.com/2015/06/02/change-dns-command-line-mac-os-x/
If I set the following DNS servers then an attempt to access the container ends up in using
8.8.8.8.However, if I log in to the container and
wget webserver.loc -qO - | catthen the domain is resolved correctly.The response of
scutil --dns:The underlying issue, I believe, is within "Docker for mac" that uses VM.
@mageddo commented on GitHub (Mar 19, 2018):
@BR0kEN-
I think you're right, I am doing some tests to get it work using docker for Windows and I think the issue is the same, no news because it`s not possible to use docker inside a VM, but now I have a Windows installation then I will try to fix it and probably the same aproach will work for MAC
@afrold commented on GitHub (Jun 4, 2018):
Was this ever solved ?
@mageddo commented on GitHub (Jun 4, 2018):
I think it never was in that case, actually I have no sure if DPS works on MAC, I recently made a doc to run it on Windows/MAC based on Windows experience hopping it to work on MAC cause they both use docker machine, it's different from the approach used on that issue. Now I'm waiting for feedback once I don't have MAC.
Can you try it out ?
@Aloren commented on GitHub (Jun 7, 2018):
Unfortunately that doesn't work :(
I've executed almost the same steps as @BR0kEN- did, but that didn't help.
@Kearny commented on GitHub (Jan 24, 2020):
Hello everyone,
Is there any news on this ? Im experiencing some issues with my Mac while with this while it works perfectly fine on another Ubuntu machine.
@mageddo commented on GitHub (Jan 24, 2020):
@Kearny I'm about to use a Mac of a friend of mine to make the tests.
I'll keep this thread updated
@Kearny commented on GitHub (Jan 28, 2020):
Hello @mageddo, any news on this ?
I'm working in a project that requires this. I confess I can't make it work on my own... 😩
@mageddo commented on GitHub (Jan 30, 2020):
@Kearny I made some tests, I have some good and not so good news.
Basically DPS works on Mac, the configuration is pretty similar as Windows, I will make a doc for that soon.
Unfortunately access container from host is not supported yet, it's a docker machine limitation . I'm thinking in a working around for this.
All other features are working perfectly, like:
Which DPS feature are you interested to work on Mac?
@Kearny commented on GitHub (Jan 30, 2020):
Hi @mageddo,
First, thanks for your time and interest.
I'm interested in being able to access different containers from my host.
I have the same name dns behind which I have one service per port.
Example:
And all the containers are able to talk to each others.
@mageddo commented on GitHub (Jan 30, 2020):
I see, Containers solve each others are supposed to work, I think additional configuration will be required.
Host solve containers works but host have no ACL to ping containers cause Mac don't have a bridge network like Linux.
@Swoorup commented on GitHub (Mar 28, 2020):
FYI, docker acknowledges that they don't support IP routing in mac.
https://docs.docker.com/docker-for-mac/networking/
There appears to be 3rd party component in the last post of this thread which might address the issue.
https://forums.docker.com/t/ip-routing-to-container/8424/15
I might give that a try and let know if it works
@Swoorup commented on GitHub (Mar 28, 2020):
@mageddo @Kearny I got it to successfully work using the mentioned tool in that post. Steps are below:
brew cask install tuntap/sbin/docker_tap_install.sh./sbin/docker_tap_up.shsudo route add -net 172.0.0.0 -netmask 255.255.0.0 10.0.75.2172.0.0.10in your mac.@Kearny commented on GitHub (Mar 30, 2020):
@mageddo @Swoorup Here we changed our solution by using TRAEFIK instead : https://docs.traefik.io/routing/providers/docker/
It work perfectly on MAC by default.
@Swoorup commented on GitHub (Apr 10, 2020):
@Kearny I looked at Traefik, it seems a bit too heavyweight for my needs. Currently running everything just locally and just need something that proxies off all ports including tcp with minimal configuration.
@MonniSoftware commented on GitHub (Apr 25, 2020):
Hello,
thanks for very interesting workaround for OSX. I got this pretty much working according to logs that I can see, only what's not working is the last point, setting Mac's DNS server to 172.0.0.10. For example 'nslookup my-ubuntu' does not find IP address, although dns-proxy-server shows in its log, that it has registered that name and it looks it would be ready for resolving that name.
My question, where does this address 172.0.0.10 come from? How can I check, that that is actually the IP address of the DNS server spawned here?
@Swoorup commented on GitHub (Apr 26, 2020):
@MonniSoftware it is the dps server ip address. https://github.com/mageddo/dns-proxy-server/blob/master/examples/custom-hostnames-compose-file/docker-compose.yml#L13
@mageddo commented on GitHub (Apr 27, 2020):
You always can use
docker inspect dns-proxy-server | lessand find out the container IP by yourself though@christhomas commented on GitHub (Dec 1, 2020):
on mac (before big sur), I used to use:
sudo networksetup -setdnsservers 'Wi-Fi' 0.0.0.0but for some reason it stopped working, so I changed it to:
`sudo networksetup -setdnsservers 'Wi-Fi' 0.0.0.0 127.001"
and it started working again. I've been using 0.0.0.0 for a couple of years and it's worked without problem up until I upgraded to big sur. It's only in the last month I had to change it. Perhaps the version of MacOS matters, but perhaps not.
@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
Checkout running it docs for Mac (actually nothing special for Mac, just some hints)
@mageddo commented on GitHub (Mar 16, 2023):
Created a dedicated tutorial for Windows and MacOSX usecase, also created this section where people can link tutorials they created, feel free to contribute.
I'm closing this issue as I consider it's solved, if you have any new issues or questions feel free to open a new issue, thanks.