DNS resolve not working on virtualbox VM when VPN is switched on host

Discussions related to using VirtualBox on Windows hosts.
Post Reply
vnox
Posts: 3
Joined: 19. Mar 2022, 09:31

DNS resolve not working on virtualbox VM when VPN is switched on host

Post by vnox »

I have Windows 10 host and Ubuntu Server guest vm on Virtualbox. I have OpenVPN client on the Windows host. The guest vm is set to NAT network(not NAT) type.

Whenever the vpn-client is switched on, traffic from host gets routed via server the OpenVPN client has connected to. But I immediately lose DNS lookup/resolve in the guest VM (Internet works fine in both guest vm & host, but dns resolve fails in my guest vm)

If VPN client is off, everything (internet, dns lookup) works fine in my host, guest VM.

Any suggestions on how to mitigate this?

Edit:
VirtualBox version: 6.1.32
Guest additions installed, Using Intel VT-X
Adapter: Intel PRO/1000 MT Desktop
Promiscuous mode: Deny
fth0
Volunteer
Posts: 5690
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: DNS resolve not working on virtualbox VM when VPN is switched on host

Post by fth0 »

Please try 9.8.5. Enabling DNS Proxy in NAT Mode and 9.8.6. Using the Host's Resolver as a DNS Proxy in NAT Mode, and tell us which one of them works for you and which doesn't. TIA.
vnox
Posts: 3
Joined: 19. Mar 2022, 09:31

Re: DNS resolve not working on virtualbox VM when VPN is switched on host

Post by vnox »

@fth0, I have enabled both natdnshostresolver1 & natdnsproxy1. Then I booted my VM. Once done, I switched on VPN on my host. Dns lookup still failed on guest !

However there was one interesting behaviour. After I realised dns lookup failed, I completely shutdown my guest VM. Then booted up again. This time everything works regardless if I connect or not to VPN on my host!
fth0
Volunteer
Posts: 5690
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: DNS resolve not working on virtualbox VM when VPN is switched on host

Post by fth0 »

I don't know which of the two options takes precedence when both are enabled, so it's not clear to me which one you've tested.
vnox
Posts: 3
Joined: 19. Mar 2022, 09:31

Re: DNS resolve not working on virtualbox VM when VPN is switched on host

Post by vnox »

I tried using only one of them at a time for both options and DNS lookup still failed :(
Post Reply