I have a Debian image setup on Virtualbox that uses the default NAT to access the internet. It was working fine before I upgraded to 12.10. After I upgraded the DNS lookups no longer work. I still can access ip addresses, but this is not a nice solution.
6 Answers
Got it
VBoxManage modifyvm "VM name" --natdnsproxy1 on
Virtual box has a DHCP server for the NAT engine. Which has a list of registered DNS servers. The above command hides this DNS server list and use the host's resolver settings, thereby forcing the VirtualBox NAT engine to intercept DNS requests and forward them to host's resolver
- 924
The --natdnsproxy1 on didn't work for me. :(
But I was able to go into the virtual machine and set my DNS server by hand, and that worked.
My host machine is resolving to the loopback device. Not sure how or why /etc/resolv.conf got set to the loopback. My host network connection has a static DNS server configured, that is NOT set to the loopback device.
But everything is resolving fine on my host machine, via the loopback. Odd.
- 9,885
- 11
I had a similar problem with DNS stop working. It happened using virtual box version 5.02r102096 running ubuntu server as guest on windows 10 64 bit as host. The problem occurred after I first activated port forwarding.
Apparently until you activate port forwarding for the NAT it automatically enables port 53 forwarding. I enabled UDP and TCP forwarding on port 53 and DNS started working again. It did not work with only UDP forwarded.
I am a little concerned that my host may no longer receive and process port 53 and will fail future DNS lookup as a result but have not tried it. If this is correct then we probably need to also forward some of the other ports like network Time.
I suspect this is a bug in VirtualBox where it should automatically enable forwarding / sharing some of these common ports unless you explicitly disable them.
I also modified the network interfaces in linux to include the name servers. /etc/network/interfaces with the line dns-nameservers xx.xx.xx.xx but this had no effect on the problem until port 53 was forwarded.
Note: I tried to post two pictures to make it more clear but the blog required a reputation of 10 so I couldn't. You can contact me via bayesanalytic.com thanks Joe E.
FYI I have grabbed the most recent version of VirtualBox (4.2.16) and it fixes this issue. No CLI commands are necessary to have working DNS on a NAT network.
- 1