minikube: virtualbox: external DNS does not work within guest VM
Is this a BUG REPORT or FEATURE REQUEST? (choose one): BUG REPORT
Minikube version (use minikube version): v0.18.0
Environment:
- OS (e.g. from /etc/os-release): OSX 10.12.4
- VM Driver (e.g.
cat ~/.minikube/machines/minikube/config.json | grep DriverName): virtualbox - ISO version (e.g.
cat ~/.minikube/machines/minikube/config.json | grep -i ISOorminikube ssh cat /etc/VERSION): minikube-v0.18.0.iso - Install tools:
- Others:
What happened: DNS doesn’t work in a container when run within my minikube cluster. I can ping hosts by IP address so there is internet connectivity. Also, if I run the container outside the cluster, pinging by hostname works.
What you expected to happen: DNS should work
How to reproduce it (as minimally and precisely as possible): Run a container and try to ping a host on the Internet by name, e.g. google.com.
Anything else do we need to know:
Can’t use the xhyve driver because of #1452 (so I haven’t tested whether this affects clusters using the xhyve driver)
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 4
- Comments: 19 (3 by maintainers)
@boosh I had same problem with Vbox driver. After few hours of test and debug, I found out that the DNS was not well managed by Vbox and was causing that error. I am using minikube version: v0.19.0
What I did to fix the issue was that : activate natdnshostresolver1 on the host. First stop the VM minikube and type the following command :
VBoxManage modifyvm "VM name" --natdnshostresolver1 onAfter, you can start the VM and it should be workingSource for info: https://forums.virtualbox.org/viewtopic.php?f=7&t=50368
Hope it will help you. Good luck
I am facing same issue with
--vm-driver=nonewhere a Pod fails to establish connection with the server running on web. Exact error string:Get https://<the-server-name>.io: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers). I am waiting for any solution, suggestion, workaround. I tried deploying CoreDNS but it didn’t help.minikube version: v0.24.0 kubectl version:
Client: 1.9.3Server: 1.8.0For now a simple workaround (tested with Hyper-V, but should work for OSX, Linux), try the following:
minikube addons enable kube-dnsminikube ssh/etc/resolv.conf(nameserver 8.8.8.8on a new line) -> vi or another editor :sudo vi /etc/resolv.conf/etc/resolv.conffile::xor:wqfor viping google.cawhile still in a Minikube SSH session, and if that works, you’re done…I just encountered the same issue running:
The
VBoxManagecommand listed above expressly remedied the problem.