VirtualBox

Ticket #6081 (closed defect: fixed)

Opened 4 years ago

Last modified 4 years ago

Update DNS server list on DHCPRELEASE/RENEW and DHCPINFORM.

Reported by: SecretCode Owned by:
Priority: major Component: network/NAT
Version: VirtualBox 3.1.2 Keywords: dns nat
Cc: Guest type: other
Host type: other

Description

Related forum thread:  NAT guest does not get correct DNS when host uses dial-up (View topic) • virtualbox.org

This applies to guests using NAT and (as default) not using the DNS proxy feature.

When the host changes its DNS servers, e.g. in the case of a notebook computer moving to a different location, or any computer where the main ADSL internet connection fails and another connection e.g. 3G is used as backup, guests are unable to retrieve the new DNS servers. It's acceptable that they have to renew the DHCP lease, but when they do so, they still get the old DNS servers. This is clearly an incorrect behaviour on the part of virtualbox.

(Guests can access sites via IP address. This only affects DNS resolution.)

Verified with both Ubuntu 9.10 host and Windows XP SP2 host running virtualbox 3.1.2 r56127, and windows XP guests. (It's the same with 3.0.12 r54655.)

The attached file shows the DHCP + DNS settings on the (windows) host and the guest before changing upstream connection, and again after changing upstream connection and running ipconfig /renew in the windows guest. Results are identical with an Ubuntu host.

Related bugs:  #4680 (If network settings are changed on host in lifetime of guest, guest can't access network) - VirtualBox describes a relevant use case, but was marked as a duplicate of  #3847 (re-initiate NAT on Network switch) - VirtualBox - the latter ticket is marked fixed by the option to use the DNS proxy feature, but that is only a workaround - the faulty behaviour when not using DNS proxy still needs to be fixed.

Attachments

DNS-server-not-correct-after-host-change.txt Download (6.9 KB) - added by SecretCode 4 years ago.
2-Ubuntu-904-main-2010-01-27-21-01-32.log Download (66.5 KB) - added by SecretCode 4 years ago.
Log - Ubuntu host, Ubuntu guest - same results

Change History

Changed 4 years ago by SecretCode

Changed 4 years ago by SecretCode

Log - Ubuntu host, Ubuntu guest - same results

comment:1 Changed 4 years ago by SecretCode

I've also confirmed the same results with an Ubuntu guest (Ubuntu 9.04). The vbox log for this session is attached.

comment:2 Changed 4 years ago by Hachiman

Please try  Use Host Resolver. In this mode guest receive x.x.x.3 as DNS server, but real resolving happens in NAT engine via host resolver API.

comment:3 in reply to: ↑ description ; follow-up: ↓ 4 Changed 4 years ago by Hachiman

Replying to SecretCode:

Related bugs:  #4680 (If network settings are changed on host in lifetime of guest, guest can't access network) - VirtualBox describes a relevant use case, but was marked as a duplicate of  #3847 (re-initiate NAT on Network switch) - VirtualBox - the latter ticket is marked fixed by the option to use the DNS proxy feature, but that is only a workaround - the faulty behaviour when not using DNS proxy still needs to be fixed.

It isn't really workaround because there're networks where DNS isn't used at all instead NIS, LDAP or IPv6 is used in such networks. Host resolver is right solution for these case and for network switching. Doing the solution you've suggested will require parsing of a lot of files and introducing several hooks into various network managers to handle IP changing, which will make a simple code and minor functionally (major NAT functionality is a TCP/IP stack and port-forwarding) abnormally big and complex.

comment:4 in reply to: ↑ 3 ; follow-up: ↓ 5 Changed 4 years ago by SecretCode

Thanks for your updates Hachiman.

Using the host resolver does address the issue, so I am able to make my own configurations work.

But I have raised this bug because I believe that vbox can work better "out of the box" - running setextradata commands may be daunting for someone who finds vbox valuable in the situations I've described.

I accept your points about environments that don't use DNS, but the vast majority still do use DNS, in my experience.

Replying to Hachiman:

Doing the solution you've suggested will require parsing of a lot of files and introducing several hooks into various network managers to handle IP changing, which will make a simple code and minor functionally (major NAT functionality is a TCP/IP stack and port-forwarding) abnormally big and complex.

That would be complicated, but I have in mind something much more simple: when the client renews the DHCP lease, check the current DNS servers on the host - instead of returning old, possibly invalid ones.

Requiring the client to do a dhcp-renew is a small inconvenience for the user. But this code change in vbox is surely very simple? It already obtains the host's DNS servers at least once; all that is needed is to repeat the check instead of relying on a stored value.

comment:5 in reply to: ↑ 4 Changed 4 years ago by Hachiman

Replying to SecretCode:

Thanks for your updates Hachiman.

Using the host resolver does address the issue, so I am able to make my own configurations work.

But I have raised this bug because I believe that vbox can work better "out of the box" - running setextradata commands may be daunting for someone who finds vbox valuable in the situations I've described.

:). I expect next versions will be managed via VBoxManage.

I accept your points about environments that don't use DNS, but the vast majority still do use DNS, in my experience.

Replying to Hachiman:

Doing the solution you've suggested will require parsing of a lot of files and introducing several hooks into various network managers to handle IP changing, which will make a simple code and minor functionally (major NAT functionality is a TCP/IP stack and port-forwarding) abnormally big and complex.

That would be complicated, but I have in mind something much more simple: when the client renews the DHCP lease, check the current DNS servers on the host - instead of returning old, possibly invalid ones.

Requiring the client to do a dhcp-renew is a small inconvenience for the user. But this code change in vbox is surely very simple? It already obtains the host's DNS servers at least once; all that is needed is to repeat the check instead of relying on a stored value.

Ok, sounds reasonable. Thanks for clarification. So let reformulate the ticket "do update of dns list on DHCPRELEASE and DHCPINFORM".

comment:6 Changed 4 years ago by Hachiman

  • Summary changed from NAT guest does not get correct DNS servers when host changes DNS servers to Update DNS server list on DHCPRELEASE/RENEW and DHCPINFORM.

comment:7 Changed 4 years ago by SecretCode

Sounds perfect.

comment:8 Changed 4 years ago by Hachiman

  • Status changed from new to closed
  • Resolution set to fixed

fixed in 3.2.

Note: See TracTickets for help on using tickets.

www.oracle.com
ContactPrivacy policyTerms of Use