Page 1 of 1

NATNetwork resolve DNS of other guests

Posted: 30. Oct 2020, 13:53
by phil-c
Hi,

Apologies if this is covered elsewhere, or if this is the wrong place to ask.

I have a VirtualBox DHCP server defined:

Code: Select all

NetworkName:    LabNet
Dhcpd IP:       192.0.0.3
LowerIPAddress: 192.0.0.10
UpperIPAddress: 192.0.0.250
NetworkMask:    255.255.255.0
Enabled:        Yes
Global Configuration:
    minLeaseTime:     default
    defaultLeaseTime: default
    maxLeaseTime:     default
    Forced options:   None
    Suppressed opts.: None
        1/legacy: 255.255.255.0
        3/legacy: 192.0.0.1
        6/legacy: 192.168.1.254
       15/legacy: lan
and it a NATNetwork defined to use it.

Code: Select all

NetworkName:    LabNet
IP:             192.0.0.1
Network:        192.0.0.0/24
IPv6 Enabled:   No
IPv6 Prefix:    fd17:625c:f037:2::/64
DHCP Enabled:   Yes
Enabled:        Yes
loopback mappings (ipv4)
        127.0.0.1=2
VM start ok using the NAT Network and have the expected connectivity - out to the internet and to each other.

What I'd like to be able to do though is perform a DNS lookup of another guest on the NATNetwork, from a guest on that NATNetwork. Is that possible?

I wouldn't expect the VBox DHCP service to (be able to) update the DNS on my main DNS server/router, but it would be good if I could resolve the other hosts on the NAT Network.

Thanks.

Re: NATNetwork resolve DNS of other guests

Posted: 30. Oct 2020, 14:33
by scottgus1
Guests on one NAT network are basically in a private LAN behind a router, see Virtualbox Networks: In Pictures: NAT network.

So what one could do in a real private LAN behind a router, one could theoretically do in a NAT network.

FWIW 192.0.#.# is not an official private IP address range and may not be properly dealt with by a router, physical or virtual.

Re: NATNetwork resolve DNS of other guests

Posted: 30. Oct 2020, 19:26
by phil-c
Thanks. I'm not overly concerned, but am aware that 192.0.0.0/24 isn't a true private network. It's been chosen for various specific reasons.

It's the "what one could do in a real private LAN behind a router, one could theoretically do in a NAT network." bit, and in particular a DNS bit, that I'm wanting to achieve.

Re: NATNetwork resolve DNS of other guests

Posted: 31. Oct 2020, 01:01
by fth0
VirtualBox offers some special DNS settings. You can read about them in 9.8. Fine Tuning the Oracle VM VirtualBox NAT Engine.

Re: NATNetwork resolve DNS of other guests

Posted: 31. Oct 2020, 07:13
by BillG
You say that what you want to do is perform a DNS lookup of another guest on the NATNetwork, from a guest on that NATNetwork.

nslookup queries a DNS server, not a device on a network. You can certainly resolve a name to an IP or vice versa, but the info comes from the DNS server, not from the PC itself. I have never tried a DNS lookup on a NAT network to see if you can resolve names to addresses. Perhaps that doesn't work on a NAT network.

I don't use NAT networks. I usually set up internal networks and connect them to the physical network through a router vm running a NAT appliance such as pfSense, which you can configure as you wish.

Re: NATNetwork resolve DNS of other guests

Posted: 31. Oct 2020, 20:04
by fth0
I've just created a working test setup, and the secret ingredient is ... mDNS. ;)

Configure the Promiscuous Mode of the VMs' network adapters to Allow VMs or Allow All. If the guest OSs support mDNS (ubiquitous these days), you can simply use the hostnames without any domain. BTW, other names you may better recognize instead of mDNS are Bonjour or Zeroconf.

Re: NATNetwork resolve DNS of other guests

Posted: 2. Nov 2020, 16:24
by phil-c
fth0 wrote:I've just created a working test setup, and the secret ingredient is ... mDNS. ;)

Configure the Promiscuous Mode of the VMs' network adapters to Allow VMs or Allow All. If the guest OSs support mDNS (ubiquitous these days), you can simply use the hostnames without any domain. BTW, other names you may better recognize instead of mDNS are Bonjour or Zeroconf.
Thanks - I'll give this a go as it sounds like it could be what I need.