[SOLVED] DNS Not Working Any Guest on Linux Mint 13/Ubuntu…

Discussions related to using VirtualBox on Linux hosts.

[SOLVED] DNS Not Working Any Guest on Linux Mint 13/Ubuntu…

Postby leehach » 8. Jul 2012, 10:17

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.
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

Postby Perryg » 8. Jul 2012, 14:33

Try this (on the host) in a terminal.
Code: Select all   Expand viewCollapse view
VBoxManage modifyvm "VM name" --natdnshostresolver1 on

Replace the "VM name" with the name of your guest and don't forget the quotes " "
Perryg
Site Moderator
 
Posts: 34209
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

Postby leehach » 9. Jul 2012, 01:51

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
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/Ubun

Postby Perryg » 9. Jul 2012, 02:03

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.
Perryg
Site Moderator
 
Posts: 34209
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/Ubun

Postby leehach » 9. Jul 2012, 02:51

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

--Lee
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/Ubun

Postby Perryg » 9. Jul 2012, 03:20

Just remember that this is a per VM fix. I am trying to investigate a global fix for this issue.
Perryg
Site Moderator
 
Posts: 34209
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/Ubun

Postby aden » 3. Feb 2013, 18:14

Works...

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

thanks
aden
 
Posts: 1
Joined: 3. Feb 2013, 18:01

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

Postby simes » 19. Oct 2014, 21:50

Perryg wrote:Try this (on the host) in a terminal.
Code: Select all   Expand viewCollapse view
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
simes
 
Posts: 1
Joined: 19. Oct 2014, 21:47

Re: [SOLVED] DNS Not Working Any Guest on Linux Mint 13/Ubun

Postby kangcontrol » 8. Apr 2015, 20:34

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

Re: [SOLVED] DNS Not Working Any Guest on Linux Mint 13/Ubun

Postby quickmana » 16. Mar 2016, 00:33

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
quickmana
 
Posts: 1
Joined: 16. Mar 2016, 00:20

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

Postby Gutchi » 4. Apr 2016, 15:04

Perryg wrote:Try this (on the host) in a terminal.
Code: Select all   Expand viewCollapse view
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 =)
Gutchi
 
Posts: 9
Joined: 4. Apr 2016, 14:50

Re: [SOLVED] DNS Not Working Any Guest on Linux Mint 13/Ubun

Postby tcat » 23. Sep 2016, 20:40

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   Expand viewCollapse view
Windows 7 host OS
Linux Mint 17.3 Rosa guest OS
VirtualBox 5.0.26
Cisco AnyConnect
tcat
 
Posts: 1
Joined: 23. Sep 2016, 20:30

Re: [SOLVED] DNS Not Working Any Guest on Linux Mint 13/Ubuntu…

Postby jamied_uk » 6. May 2017, 00:19

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

Re: [SOLVED] DNS Not Working Any Guest on Linux Mint 13/Ubuntu…

Postby Perryg » 6. May 2017, 00:31

@ 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.
Perryg
Site Moderator
 
Posts: 34209
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…

Postby jamied_uk » 6. May 2017, 00:32

Ok thanks for not removing b4 i had chance to copy and paste question lol.
jamied_uk
 
Posts: 4
Joined: 17. Mar 2011, 17:47
Location: England
Primary OS: MS Windows 7
VBox Version: OSE other
Guest OSses: Linux Mint 18 & Kali Linux 2


Return to VirtualBox on Linux Hosts

Who is online

Users browsing this forum: No registered users and 14 guests