minikube: hyperkit: external DNS resolution fails: conflict with DNS server running on host
Is this a BUG REPORT or FEATURE REQUEST? (choose one): BUG REPORT
Please provide the following details:
Environment: MacOS High Sierra
Minikube version (use minikube version): 0.25.0 and above
- OS (e.g. from /etc/os-release): MacOS High Sierra, version 10.13.6
- VM Driver (e.g.
cat ~/.minikube/machines/minikube/config.json | grep DriverName): hyperkit - ISO version (e.g.
cat ~/.minikube/machines/minikube/config.json | grep -i ISOorminikube ssh cat /etc/VERSION): .minikube/cache/iso/minikube.25.0.0.iso - Install tools: curl -#Lo minikube https://storage.googleapis.com/minikube/releases/v0.25.0/minikube-darwin-amd64 && chmod +x minikube && sudo mv minikube /usr/local/bin/
- Others:
What happened: dns in minikube does not work. DNS cluster can not start, because can not download images from registry. 192.168.64.1 - it is my host IP
nslookup ya.ru
Server: 192.168.64.1
Address 1: 192.168.64.1
nslookup: can't resolve 'ya.ru'
What you expected to happen: DNS works. If I change DNS server in minikube to 8.8.8.8, it works.
su root
rm -f /etc/resolv.conf && echo nameserver 8.8.8.8 > /etc/resolv.conf
nslookup ya.ru
Server: 8.8.8.8
Address 1: 8.8.8.8 google-public-dns-a.google.com
Name: ya.ru
Address 1: 87.250.250.242 ya.ru
Address 2: 2a02:6b8::2:242 ya.ru
How to reproduce it (as minimally and precisely as possible):
minikube stop && minikube delete
minikube start --vm-driver hyperkit
Output of minikube logs (if applicable):
Anything else do we need to know:
About this issue
- Original URL
- State: open
- Created 6 years ago
- Reactions: 38
- Comments: 41 (10 by maintainers)
I am using minikube using the hyperkit driver on macOS and experiencing the same problems with dnscrypt-proxy, which listens on 127.0.0.1:53 (udp+tcp). This binary is part of the Cisco Umbrella (corporate OpenDNS) roaming client. I cannot modify the configuration used by dnscrypt-proxy. The dnsmasq.conf changes linked are insufficient to resolve the issue for others.
Is there no way to apply a persistent DNS configuration change to minikube and the system pods?
I’ve upped the priority based on the number of votes. Help wanted!
We’re hitting this issue and also have an Umbrella / dnscrypt-proxy setup we can’t change.
As a possible workaround, it appears that using Docker Desktop’s
vpnkit, e.g.minikube start ... --hyperkit-vpnkit-sock=/Users/zarenner/Library/Containers/com.docker.docker/Data/vpnkit.eth.sockworks, correctly forwarding DNS requests to dnscrypt-proxy. But it’s not really ideal since we’d rather not also have Docker Desktop installed and running in addition to minikube. I’m not sure if running a separate vpnkit instance would make more sense.In my case, I have something listening on
:53and this process running:/usr/local/opt/dnsmasq/sbin/dnsmasq --keep-in-foregroundkubedebug.log
Update, fix to my issue: dnsmasq was running and ignoring the dns request, since it was not listening to the right local addresses
Note: If
dnsmasq.confcontainslisten-address=127.0.0.1kubernetes discovers dns at 127.0.0.1:53 and tries to use it using bridge ip address, but dnsmasq replies only to reqests from 127.0.0.1My
/usr/local/etc/dnsmasq.conflooks like that:Also, please check if the host (Mac OS) has anything listening on port 53 already, or specifically, if dnsmasq is running.
I has run into this issue and it take me a while to fix that. This happends actually only with dnsmasq (or any other dns service) locally installed.
Here is my working dnsmasq.conf for anyone who may get into this error, too. Ofc you need to restart dnsmasq after adding the listen-address.
It seems there is progress ongoing … there is an open PR with a workaround: https://github.com/kubernetes/minikube/pull/3003/files
I was having the same issue on OS X running
minikubewith also havingdnscrypt-proxywhich config I can’t change. Adding this to my/etc/pf.confseems to have fixed it (bridge100 is the hyperkit created bridge):looks like in my case it’s
mDNSResponderthat’s using port 53?@nikolay-te Discovered that pf is angry if you don’t put the rule in the right order:
So I: /etc/pf.conf
sudo pfctl -f /etc/pf.conf
I’m on a Mac that’s smothered with Cisco Umbrella sauce. BTW, I can’t run minikube AT ALL unless I disconnect from my corporate VPN
This allowed my minikube VM to hit my corporate private registry url via Umbrella’s DNS
I also have dnscrypt-proxy running:
Hey folks, you need to check the IP Adresses and the DNS resolution. This issue is mostly based on wrong proxy or dns settings. Just make sure, that the routing and dns is correct and everything will be fine.
If you have dnsmasq, you need to extend your configuration like here
Any other issue should be traced back.
Can someone on this thread that doesn’t have “Cisco Umbrella sauce” (sadly, that includes me) do a
sudo lsof -i :53, and post the output?In particular, I’m wondering if minikube’s DNS server, whatever that is, is trying to bind to all interfaces, instead of just the bridge. If I’m looking at this right, I’m wondering why there should be a conflict here: Umbrella only binds to
localhost, so a bind to the bridge shouldn’t be affected by it. But, if minikube were instead trying to bind to all interfaces, then that would be a different story. Thelsoffrom a normal setup should help answer that.our current integration machines are out of work due to covid (they were in the office) we are looking into adding mac integration tests, once we have integration back, I would accept a PR that adds integration tests that fixes this issue
I was just investigating another DNS-related issue on my colleagues OS X High Sieera, and it turns out, it’s really terrible.
He has a mDNSresponder service occupying *:53/UDP. It does not actually respond to any of the requests made by the minikube VM. So, DNS is effectively broken for the VM, using HyperKit. We did not know about the DNSresponder thingie, since we installed dnsmasq, and began using it. Eventually, we realized it’s failing to start exactly because it cannot bind.
I think this is yet one more example of horrific engineering on Apple’s side. I am not saying everything they do is garbag, but WHY on earth would you have a service that (according to Google) is there to support Bonjour (kind of a discorery protocol) occupiying *:53???
If there was at least a way how to tell it not to occupy ALL the ip addresses, such that actually useful software could listen on them instead 😃
EDIT: You could possibly maybe tell Minikube to use a different IP for the DNS resolution, as routing seems to be working, but if you need that IP to be dnsmasq, you will have to host ti likely on a different VM, not the OS X 😦((
This seems to help in the meantime:
I did that and also had to restart
dnsmasqto make it work (for macOS):I can confirm that @zarenner’s solution works with adding a line for listen-address for 192.168.64.1
Currently facing the same issue on linux with dnsmasq