Sign up ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

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.

share|improve this question
Upstream VirtualBox bug: –  Piët Delport Mar 1 '13 at 8:55

6 Answers 6

In addition to VBoxManage modifyvm "name" --natdnsproxy1 on, I also had to run VBoxManage modifyvm "name" --natdnshostresolver1 on on each of my VMs to get DNS working. I found that tip on this page.

share|improve this answer
Thanks for this! It did the trick for me. –  Shimon Rura Dec 23 '12 at 15:16
Sweet, found it somewhere else and it worked for me... then saw this hit a little further down the search results so had to vote it up. –  El Yobo Jan 12 '13 at 11:40
Only "--natdnshostresolver1 on" should actually be necessary, not "--natdnsproxy1 on". –  Piët Delport Mar 1 '13 at 10:30
This did not work. Both of them. I am using this batch script ( and does not work.The adapter type is PCnet-PCI II –  kapitanluffy Mar 24 '13 at 20:37
I have set the resolv.conf to and it worked. Do I still need to issue the modifyvm commands? –  kapitanluffy Mar 24 '13 at 20:44
up vote 11 down vote accepted

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

share|improve this answer
Do you know if there is a way to set this as the default, or change this in the GUI? I'm having the same issue, but typing that for all my VMs seems like a lot of work I'd rather avoid. Thanks. –  dobey Oct 23 '12 at 3:14
@dobey I'm petty sure you cant do this in the GUI. If you have a lot I would probably write a script. You can get list of your VMs names with VBoxManage list vms Then just iterate through that list –  null_radix Oct 23 '12 at 23:51
That's unfortunate if so. There should be a way to set it as the default. Perhaps the package needs patched or something then. :-/ –  dobey Oct 24 '12 at 0:26

Apparently you need to upgrade VritualBox to 4.2, otherwise it won't work

share|improve this answer
Is this your personal experience? Did you find this documented anywhere? –  Lord Loh. Nov 2 '12 at 20:21
I can confirm (from personal experience) that upgrading to 4.2 seems to fix the issue... my box wasn't able to connect to the internet, after the update it magically works. –  Ben Dec 17 '12 at 11:47

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.

share|improve this answer
Oops, just realized it isn't the loopback, it is instead; Received 43 bytes from in 67 ms Which seems to be explained here;… –  Ted Parvu Oct 24 '12 at 21:23
It is the loopback device, but it is not localhost. The DNS entry pointing to though, is a result of Ubuntu using a local caching nameserver, which is running on that interface. –  dobey Oct 24 '12 at 21:37

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 thanks Joe E.

share|improve this answer
This does not really answer the question. If you have a different question, you can ask it by clicking Ask Question. You can also add a bounty to draw more attention to this question once you have enough reputation. –  Pilot6 Aug 31 at 9:47

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.