Skip to content
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

Make Docker internal DNS name resolution service available to OSX through the VPN #18

Open
dw-ec opened this issue Apr 21, 2023 · 1 comment

Comments

@dw-ec
Copy link

dw-ec commented Apr 21, 2023

Using 4km3/dnsmasq it's possible to run a resolver that passes DNS queries through to Docker's internal name resolution service. This works for container names, as well as network alias names.

It would be really handy if the docker-mac-network ovpn server could push the DNS proxy container's IP as a resolver when the VPN is connected, allowing users to access their docker containers by name / hostname / alias, rather than by IP address.

I've got this working in a demo project but it requires manual editing of the .ovpn file before importing into tunnelblick.

@wojas
Copy link
Owner

wojas commented Apr 25, 2023

Overriding the system DNS settings is undesirable in most cases, but macOS does provide a mechanism to override resolution only for a specific domain or subdomain.

For example, you can create a /etc/resolver/example.com file with contents like:

nameserver 192.0.2.1

I would accept a PR that adds some kind of proxy DNS server that exposes the internal docker DNS and clearly documents how to create the local resolver file to access it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants