Page 1 of 1

[Solved] DNS Not Working Any Guest on Linux Mint 13/Ubuntu 12.04

Posted: 8. Jul 2012, 10:17
by leehach
Just upgraded from VBox 3.1.x on Ubuntu 10.04 to VBox 4.1.12 on Linux Mint 13, which is based on Ubuntu 12.04. I installed the Oracle version of VBox from the standard repository, 4.1.12-77245~Ubuntu~precise. I have several virtual machines, including WinXP, Win7, Ubuntu 12.04, and OSGeo-Live (a Xubuntu-based geographic distro). I have DNS configured on my router, not on my host OS.

Running on 10.04, DNS lookup is working from all guest OSes. After upgrading the OS and the VBox version, DNS lookup is not working in any of them. If I set DNS "manually", i.e. in each guest OS, then everything works. Obviously, it would be easier to rely on setting DNS servers in just one place (i.e., the router). I did test setting DNS on the *host* OS, and reboot a guest OS to see if it would find the DNS server there, but that didn't work either.

All guest OSes are set to NAT. WinXP and OSGeo-Live are using the PCnet-FAST III adapter. Win7 and Ubuntu 12.04 are using the Intel PRO/1000 MT Desktop adapter.

Any ideas why this is and how to fix it?

Thanks,
--Lee

Re: DNS Not Working Any Guest on Linux Mint 13/Ubuntu 12.04

Posted: 8. Jul 2012, 14:33
by Perryg
Try this (on the host) in a terminal.

Code: Select all

VBoxManage modifyvm "VM name" --natdnshostresolver1 on
Replace the "VM name" with the name of your guest and don't forget the quotes " "

Re: DNS Not Working Any Guest on Linux Mint 13/Ubuntu 12.04

Posted: 9. Jul 2012, 01:51
by leehach
Awesome. Fixed the problem exactly.

So, was this an issue because I pulled the VMs from my old OS to my new OS? Or will to have to do these steps for each new VM that I create?

Thanks,
--Lee

Re: [Solved] DNS Not Working Any Guest on Linux Mint 13/Ubuntu 12.04

Posted: 9. Jul 2012, 02:03
by Perryg
Actually it is because Ubuntu in their infinite wisdom decided to change the way the (default) resolv.conf works so VPN users had it easier. So it was nothing you did. You can change it back to the original/everyone else's default but the command I sent you will allow it to work with the new settings. Google it and you can decide how you want to proceed.

Re: [Solved] DNS Not Working Any Guest on Linux Mint 13/Ubuntu 12.04

Posted: 9. Jul 2012, 02:51
by leehach
Thanks, Perryg. Will investigate further, but for now the fix you gave will suffice.

--Lee

Re: [Solved] DNS Not Working Any Guest on Linux Mint 13/Ubuntu 12.04

Posted: 9. Jul 2012, 03:20
by Perryg
Just remember that this is a per VM fix. I am trying to investigate a global fix for this issue.

Re: [Solved] DNS Not Working Any Guest on Linux Mint 13/Ubuntu 12.04

Posted: 3. Feb 2013, 18:14
by aden
Works...

Great problem solved, now have my file sync back...

thanks

Re: [Solved] DNS Not Working Any Guest on Linux Mint 13/Ubuntu 12.04

Posted: 19. Oct 2014, 21:50
by simes
Perryg wrote:Try this (on the host) in a terminal.

Code: Select all

VBoxManage modifyvm "VM name" --natdnshostresolver1 on
Replace the "VM name" with the name of your guest and don't forget the quotes " "
Thanks for this Perryg! As already stated above - this really is an AWESOME fix :D

Re: [Solved] DNS Not Working Any Guest on Linux Mint 13/Ubuntu 12.04

Posted: 8. Apr 2015, 20:34
by kangcontrol
Just signed up to say thank you for this solution~

Re: [Solved] DNS Not Working Any Guest on Linux Mint 13/Ubuntu 12.04

Posted: 16. Mar 2016, 00:33
by quickmana
I know this is an old post but it still comes up on google near the top for this problem. I had this problem and worked around the issue using the VBoxManage command above. It worked for a long time but then stopped working again today. I ran tcpdump and saw a dns packet leaving my Ubuntu vm, wireshark on windows host saw it resolve and return a response back to the vm... very frustrating! My Arch box works just fine with resolv.conf generated traditionally, but Ubuntu couldn't resolve DNS with resolv.conf at localhost (via dnsmask).

I couldn't figure it out, I ended up disabling dnsmask

sudo vi /etc/NetworkManager/NetworkManager.conf
#dns=dnsmasq
sudo restart network-manager

My resolv.conf changes from localhost to the nameservers specified by cisco anyconnect. It is able to resolve now (although it was able to before -- just didn't work!)

This works for now but i'm curious why this combination breaks, and only sometimes!:
W7 host
Ubuntu 14.04 guest with default dnsmasq running
Cisco Anyconnect

Re: [Solved] DNS Not Working Any Guest on Linux Mint 13/Ubuntu 12.04

Posted: 4. Apr 2016, 15:04
by Gutchi
Perryg wrote:Try this (on the host) in a terminal.

Code: Select all

VBoxManage modifyvm "VM name" --natdnshostresolver1 on
Replace the "VM name" with the name of your guest and don't forget the quotes " "
Just say thank you, it run for me =)

Re: [Solved] DNS Not Working Any Guest on Linux Mint 13/Ubuntu 12.04

Posted: 23. Sep 2016, 20:40
by tcat
quickmana wrote:I ended up disabling dnsmask

sudo vi /etc/NetworkManager/NetworkManager.conf
#dns=dnsmasq
sudo restart network-manager

My resolv.conf changes from localhost to the nameservers specified by cisco anyconnect. It is able to resolve now (although it was able to before -- just didn't work!)
Thank you for this! I tried using the original suggestion to run the VBoxManage command on my host OS, but it did not fix the issue for me (although it did seem to work for many others). Doing as you suggested, however, has allowed my VM to perform DNS resolution properly again. Unfortunately, this does not work with the "Bridged Adapter" network adapter enabled in the VM settings, so I had to use NAT, instead (I'm currently looking for an alternative solution).

Nevertheless, thank you for posting this helpful answer!

For reference, here is my system configuration:

Code: Select all

Windows 7 host OS
Linux Mint 17.3 Rosa guest OS
VirtualBox 5.0.26
Cisco AnyConnect

Re: [Solved] DNS Not Working Any Guest on Linux Mint 13/Ubuntu 12.04

Posted: 6. May 2017, 00:19
by jamied_uk
my host is Windows 7 with latest virtual box

client is kali linux and mint 18 and mint 17 (i use all 3 of these) and when i try to restart network-manager service it never works (i mean the internet will not return until reboot) how can i fix this please?

Re: [Solved] DNS Not Working Any Guest on Linux Mint 13/Ubuntu 12.04

Posted: 6. May 2017, 00:31
by Perryg
@ jamied_uk,
You say your host is Windows and you posted in the Linux host section. I would repost in the Windows host section and see what they have to say.

Re: [Solved] DNS Not Working Any Guest on Linux Mint 13/Ubuntu 12.04

Posted: 6. May 2017, 00:32
by jamied_uk
Ok thanks for not removing b4 i had chance to copy and paste question lol.