Inside vbox6.1 on an Ubuntu Desktop host. I have a software requirement for a host-only network adapter with internet access. I was able to configure this and I can successfully ping the guest from the host and the guest has internet access via the host-only adapter.
I have one remaining problem, local dns resolution.
In order to get internet access to the guest I had to use ip MASQUERADE from the vboxnet0 address to the primary network interface of the host.
This caused one side effect. Although the guest has a bind9 server configured and runnng correctly, the host machine can only resolve IP address from the guest, not domain names. For example
I can reach the guest's server control panel using:
https://192.168.64.87:3080
But I cannot not reach the server control panel using:
https://test.example.com:3080
The host machine has resolvconf installed, but it seems that ip Masquerade is causing the content of the host machine's /etc/hosts file to skipped / ignored and attempts to directly resolve domains from public dns servers.
when I use dig example.com it shows that the dns of my production server is being utilized to try to resolve test.example.com which doesn't exist on the production server.
How can I force the host's machine's resolvconf (or another tool) to resolve domain names on the guest server so that I can view them in the host's web browser?
Progress Update
My host machine's /etc/resolv.conf has:
nameserver 192.168.61.2
nameserver 127.0.0.1
search hitronhub.home
where 192.168.61.2 is the ip address of the vboxnet0 dhcp server
I have also been some more research and installed dnsmasq as recommended here
Now, when I run dig example.com it does not show my productions nameserver. It doesn't show any nameserver and fails. (I have not fully configured dnsmasq yet)
Any tips appreciated