Opened 15 years ago
Closed 15 years ago
#6081 closed defect (fixed)
Update DNS server list on DHCPRELEASE/RENEW and DHCPINFORM.
Reported by: | Joe | Owned by: | |
---|---|---|---|
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 (2)
Change History (10)
by , 15 years ago
Attachment: | DNS-server-not-correct-after-host-change.txt added |
---|
by , 15 years ago
Attachment: | 2-Ubuntu-904-main-2010-01-27-21-01-32.log added |
---|
comment:1 by , 15 years ago
I've also confirmed the same results with an Ubuntu guest (Ubuntu 9.04). The vbox log for this session is attached.
comment:2 by , 15 years ago
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.
follow-up: 4 comment:3 by , 15 years ago
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.
follow-up: 5 comment:4 by , 15 years ago
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 by , 15 years ago
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 by , 15 years ago
Summary: | NAT guest does not get correct DNS servers when host changes DNS servers → Update DNS server list on DHCPRELEASE/RENEW and DHCPINFORM. |
---|
Log - Ubuntu host, Ubuntu guest - same results