DNS lookup for NAT resets when computer does

Discussions related to using VirtualBox on Windows hosts.

DNS lookup for NAT resets when computer does

Postby HofDS » 22. Apr 2021, 19:40

I'm running

Version 6.1.16 r140961 (Qt5.6.2) on Windows 10

After installing VB and selecting NAT as my network configuration of choice, I could ping the outside internet, but couldn't resolve websites by name.

I resolved the problem by running

Code: Select all   Expand viewCollapse view
./VBoxManage.exe modifyvm "Ubuntu NiFi" --natdnshostresolver1 on


from the VB directory via PowerShell.

This seemed to solve my DNS problem immediately, but the modification seems to only last temporarily. Every time the host computer restarts I have to rerun the command.

I'd like to be able to have VB always use the host for DNS resolution as I run VPNs on the host and need to access the host's current understanding of DNS instead of Googles.

I'd appreciate any help on how to permanently make VB use the host for resolving URLs.
HofDS
 
Posts: 3
Joined: 22. Apr 2021, 19:30

Re: DNS lookup for NAT resets when computer does

Postby fth0 » 22. Apr 2021, 20:19

I'm not sure about this, but you could try if the natdnsproxy option works for you. For details, see 9.8.5. Enabling DNS Proxy in NAT Mode.
fth0
Volunteer
 
Posts: 1843
Joined: 14. Feb 2019, 03:06
Location: Germany
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...

Re: DNS lookup for NAT resets when computer does

Postby HofDS » 22. Apr 2021, 20:32

UPDATE:

it actually just happened after shuting down the guest and the restarting the guest.
HofDS
 
Posts: 3
Joined: 22. Apr 2021, 19:30

Re: DNS lookup for NAT resets when computer does

Postby HofDS » 22. Apr 2021, 20:39

@ fth0

I will try it, but why would VBManage.exe make a permanent change with one and not the other?
HofDS
 
Posts: 3
Joined: 22. Apr 2021, 19:30

Re: DNS lookup for NAT resets when computer does

Postby scottgus1 » 22. Apr 2021, 20:45

I tried the " --natdnshostresolver1 on" command on a scrap VM I had, and the following lines were added to the NAT adapter XML:

<Network>
<Adapter slot="0" enabled="true" MACAddress="0800276AE2E5" cable="true" type="82540EM">
<NAT>
<DNS use-host-resolver="true"/>
</NAT>
</Adapter>
</Network>


Check to see if that line gets added to your VM's .vbox file after you run the command, and if it is still there after your host reboots, then if it is still there after you run and shut down the VM.
scottgus1
Site Moderator
 
Posts: 11589
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: DNS lookup for NAT resets when computer does

Postby fth0 » 23. Apr 2021, 01:32

HofDS wrote:I will try it, but why would VBManage.exe make a permanent change with one and not the other?

I can only make an educated guess: Whereas the DNS Proxy mode probably almost always works, the Host's Resolver mode only works if VirtualBox knows how to find it. If the latter does not work out, this mode is not used, and perhaps the configuration setting is then turned off, leading to it being omitted when writing back the .vbox file after the VM is shut down.
fth0
Volunteer
 
Posts: 1843
Joined: 14. Feb 2019, 03:06
Location: Germany
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...


Return to VirtualBox on Windows Hosts

Who is online

Users browsing this forum: No registered users and 28 guests