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

Discussions related to using VirtualBox on Linux hosts.
Post Reply
leehach
Posts: 8
Joined: 18. Oct 2008, 22:40
Primary OS: Ubuntu 12.04
VBox Version: PUEL
Guest OSses: WinXP, Win7, OSGeo-Live

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

Post 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
Last edited by leehach on 9. Jul 2012, 01:56, edited 1 time in total.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

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

Post 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 " "
leehach
Posts: 8
Joined: 18. Oct 2008, 22:40
Primary OS: Ubuntu 12.04
VBox Version: PUEL
Guest OSses: WinXP, Win7, OSGeo-Live

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

Post 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
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

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

Post 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.
leehach
Posts: 8
Joined: 18. Oct 2008, 22:40
Primary OS: Ubuntu 12.04
VBox Version: PUEL
Guest OSses: WinXP, Win7, OSGeo-Live

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

Post by leehach »

Thanks, Perryg. Will investigate further, but for now the fix you gave will suffice.

--Lee
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

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

Post by Perryg »

Just remember that this is a per VM fix. I am trying to investigate a global fix for this issue.
aden
Posts: 1
Joined: 3. Feb 2013, 18:01

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

Post by aden »

Works...

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

thanks
simes
Posts: 1
Joined: 19. Oct 2014, 21:47

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

Post 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
kangcontrol
Posts: 1
Joined: 8. Apr 2015, 20:34

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

Post by kangcontrol »

Just signed up to say thank you for this solution~
quickmana
Posts: 1
Joined: 16. Mar 2016, 00:20

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

Post 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
Gutchi
Posts: 34
Joined: 4. Apr 2016, 14:50

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

Post 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 =)
tcat
Posts: 1
Joined: 23. Sep 2016, 20:30

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

Post 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
jamied_uk
Posts: 11
Joined: 17. Mar 2011, 17:47
Primary OS: MS Windows 7
VBox Version: OSE other
Guest OSses: Linux Mint 18 & Kali Linux 2
Location: England
Contact:

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

Post 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?
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

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

Post 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.
jamied_uk
Posts: 11
Joined: 17. Mar 2011, 17:47
Primary OS: MS Windows 7
VBox Version: OSE other
Guest OSses: Linux Mint 18 & Kali Linux 2
Location: England
Contact:

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

Post by jamied_uk »

Ok thanks for not removing b4 i had chance to copy and paste question lol.
Post Reply