resolvconf in ubuntu 12.04 host breaks DNS in WinXP guest

Discussions related to using VirtualBox on Linux hosts.

resolvconf in ubuntu 12.04 host breaks DNS in WinXP guest

Postby aff1234 » 15. May 2012, 07:49

Ubuntu 12.04 host, WinXP SP3 guest.

The recent change in DNS handling in Ubuntu 12.04 is described here. It means that a NAT'ed WinXP host will receive a 127.0.0.1 DNS server IP, which prevents DNS from working out-of-the-box in the guest.

A workaround is to set the DNS Server(s) manually in the guest every time.

What is the recommended virtualbox setup for hosts running resolvconf (assuming the host does not have a static IP) to make DNS work seamlessly in the guest?
aff1234
 
Posts: 4
Joined: 16. Mar 2011, 11:55
Primary OS: Ubuntu other
VBox Version: PUEL
Guest OSses: WinXP

Re: resolvconf in ubuntu 12.04 host breaks DNS in WinXP gues

Postby Perryg » 15. May 2012, 14:34

If it were me I would disable it. Way too much interference from network managers that try to do everything and sometimes get it wrong. Leaving the end user with the OMG what do I do now?
Perryg
Site Moderator
 
Posts: 34372
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: resolvconf in ubuntu 12.04 host breaks DNS in WinXP gues

Postby aff1234 » 18. May 2012, 11:40

Perryg wrote:If it were me I would disable it.

You suggest in order to make Virtualbox run on Ubuntu 12.04 one have to modify the default configuration? I think that is too much to ask of the average Virtualbox user.
aff1234
 
Posts: 4
Joined: 16. Mar 2011, 11:55
Primary OS: Ubuntu other
VBox Version: PUEL
Guest OSses: WinXP

Re: resolvconf in ubuntu 12.04 host breaks DNS in WinXP gues

Postby Perryg » 18. May 2012, 15:42

Just stating my opinion. I would not use anything that can assign what they want you to use for DNS. dnsmasq is just another means to control where you go.

I see that they even stated:
This was done to better support split DNS for VPN users and to better handle DNS failures and fallbacks. This dnsmasq server isn’t a caching server for security reason to avoid risks related to local cache poisoning and users eavesdropping on other’s DNS queries on a multi-user system.


To think that this will never be exploited is naive.
Look at all the backdoor items that have been added to other distros, including MS, Apple, Etc. to track where you go and what you do and supply what they want you to have.

[End of my opinion/rant]

You can post this at bugtracker where the DEVs live and see if they can make any adjustments.
Perryg
Site Moderator
 
Posts: 34372
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: resolvconf in ubuntu 12.04 host breaks DNS in WinXP gues

Postby tigris666 » 4. Jun 2012, 16:11

My opinion on resolvconf aside, I agree with the OP in that virtualbox NAT should work "out-of-the-box" on both host and guest. If my host has perfect internet access, then I see no reason that I should have to alter network settings on my host OS to make virtualbox guests work.

Having said that, the new changes to ubuntu 12.04 work OK for me with an ubuntu host and an ubuntu guest. My /etc/resolv.conf on host ends up with nameserver 127.0.0.1 in it, and /etc/resolv.conf on the guest ends up with nameserver 10.0.2.2 in it, and the search domains are the same on both.

I'm unsure if it's a windows guest specific problem the OP is perhaps mentioning? It is hard to tell from his post if he is mentioning a problem at all, or perhaps speculating it "might" be a problem.

I *did* however hit one problem with resolvconf, and that was using Linux Mint 13 (maya) as the host, which also ships with resolvconf by default, but does NOT set the option to generate the /etc/resolv.conf symlink by default. There are bug reports for this on the mint forums, some speculating it's a bug and others saying it's not. Since DNS works fine on the desktop (host) OS itself, there is no real need for an /etc/resolv.conf file. However it seems for NAT to work in VirtualBox, that file is mandatory.
tigris666
 
Posts: 2
Joined: 4. Jun 2012, 16:00

Re: resolvconf in ubuntu 12.04 host breaks DNS in WinXP gues

Postby martyscholes » 4. Jun 2012, 17:38

It looks like the VirtualBox team already planned for this scenario.

http://www.virtualbox.org/manual/ch09.html#nat_host_resolver_proxy

Using the host's resolver as a DNS proxy in NAT mode

For resolving network names, the DHCP server of the NAT engine offers a list of registered DNS servers of the host. If for some reason you need to hide 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, use the following command:

VBoxManage modifyvm "VM name" --natdnshostresolver1 on
martyscholes
 
Posts: 202
Joined: 11. Sep 2011, 00:24
Primary OS: Solaris
VBox Version: PUEL
Guest OSses: Win 7, Ubuntu, Win XP, Vista, Win 8, Mint, Pear, Several Linux Virtual Appliances

Re: resolvconf in ubuntu 12.04 host breaks DNS in WinXP gues

Postby tigris666 » 4. Jun 2012, 18:47

martyscholes wrote:VBoxManage modifyvm "VM name" --natdnshostresolver1 on


Nice find. Not sure I understand the difference between natdnshostresolver1 and natdnsproxy1, they both sound the same to me. In fact, the description for natdnsproxy1 makes it sound like it should almost be the default for laptops or other machines that will change networks often.

I wonder why either of these aren't just defaults, perhaps speed I guess, faster to ask DNS directly rather than proxy/intercept?

I also wonder if one of these should be the default when no /etc/resolv.conf file is found, or no name servers at all are found perhaps, regardless of host OS.
tigris666
 
Posts: 2
Joined: 4. Jun 2012, 16:00

Re: resolvconf in ubuntu 12.04 host breaks DNS in WinXP gues

Postby martyscholes » 4. Jun 2012, 19:22

tigris666 wrote:Nice find. Not sure I understand the difference between natdnshostresolver1 and natdnsproxy1, they both sound the same to me.


While I am in no way a DNS expert, I believe the distinction is that the natdnsproxy1 forwards the requests to the DNS servers listed by the host, while natdnshostresolver1 asks the host itself to resolve, which means the host might make use of any /etc/host entries in addition to DNS.

tigris666 wrote:In fact, the description for natdnsproxy1 makes it sound like it should almost be the default for laptops or other machines that will change networks often.

I wonder why either of these aren't just defaults, perhaps speed I guess, faster to ask DNS directly rather than proxy/intercept?


I suspect this all took place because for the entire history of DNS, up until very recently, the host's DNS list was a valid list of IP addresses for DNS servers. Once the recent Ubuntu change took place, the host has an IP address of a DNS server that is valid only on the host. This changes all of the assumptions.

tigris666 wrote:I also wonder if one of these should be the default when no /etc/resolv.conf file is found, or no name servers at all are found perhaps, regardless of host OS.


The /etc/resolv.conf goofiness is an artifact of changing fundamental assumptions of DNS and IP addresses. If anything, VirtualBox maybe should default to natdnshostresolver1 or natdnsproxy1 if the host has a DNS address of localhost.
martyscholes
 
Posts: 202
Joined: 11. Sep 2011, 00:24
Primary OS: Solaris
VBox Version: PUEL
Guest OSses: Win 7, Ubuntu, Win XP, Vista, Win 8, Mint, Pear, Several Linux Virtual Appliances


Return to VirtualBox on Linux Hosts

Who is online

Users browsing this forum: dnmm, Google [Bot] and 12 guests