Virtualbox Linux guest DNS problems Anyconnect

If you’re running a Linux guest in Virutalbox with a Windows host and you’re using AnyConnect, primarily connected to a VPN, you may experience issues with DNS resolution in your Linux guest, generally in NAT mode. The fix isn’t very obvious up front but isn’t too hard to fix. Below is how to use the VBoxManage.exe tool to setup a “DNS Proxy” on the Windows host for your Linux guest; thus, your DNS resolution will come from the Windows host itself.

Open CMD or CYGWIN:

cd c:\Program Files\Oracle\Virtualbox
VBoxManage.exe modifyvm "your_Linux_VM_guest_name_here" --natdnshostresolver1 on

Note: You still need to keep the double quotes around your guest name.