[Solved] set DNS to hosts static vboxnet0 address

Discussions related to using VirtualBox on Linux hosts.
Post Reply
JayLL
Posts: 2
Joined: 23. Jan 2018, 16:43

[Solved] set DNS to hosts static vboxnet0 address

Post by JayLL »

My setup:
I have two virtual machines running on virtualbox which is on a Mint host.

The two virtual machines are connected to a host-only network: vboxnet0
The DHCP server for vboxnet0, is set on one of the virtualmachines, using nethserver.
This nethserver also does the DNS.

The idea is that the other guest OS, gets dhcp, domain, AD etc from nethserver.
(Nethserver itself connects to the internet using a bridged connection on the wireless interface. )
This works.
From nethserver CLI, I can ping, and I can find that machine doing nslookup, using the IP, and reverse, using the hostname.

The problem:
I can't connect to the guest OS's using the hostname

My host system can ping both the guests.
However, when I try to do a nslookup, I get the NXDOMAIN reply, because the host only looks at 127.0.0.1

The vboxnet address on the host is static so it doesn't get the DNS data from the Guest.
In Virtualbox, it's not possible to set the DNS for vboxnet0 static config. (Using the GUI)

Is this possible using the CLI with vboxmanage?
Should I use another network type?
- Bridged may be an option, but then I need an external switch. Since I want to duplicate this setup a number of times, I want to avoid external hardware.

thoughts?
Last edited by socratis on 26. Jan 2018, 09:45, edited 1 time in total.
Reason: Marked as [Solved].
JayLL
Posts: 2
Joined: 23. Jan 2018, 16:43

Re: set DNS to hosts static vboxnet0 address

Post by JayLL »

Ok, solved it myself, but as this may help others, here's what caused the issues.

The wireless router, needs it's own DHCP, to be able to connect to it.
Also, the host OS needs to bring up the wireless link, so you cannot use it on the VBox guest without having it active on the Host.

I'm now only using a bridged network connection on the wired connection.
I also have a host-only network, to have an additional administrative connection to my server. This one is static addresses only.
The only DHCP server in the network is now on my server.

DHCP, DNS, etc, are now all working fine.

I can now also connect other hosts and guests to this wired network through a switch/hub, which can all be pinged, reached and looked up using hostnames.
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: set DNS to hosts static vboxnet0 address

Post by socratis »

I'm not quite sure that this is a VirtualBox issue, but thank you nonetheless, it may help future searchers. Marking as [Solved].
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Post Reply