NATNetwork resolve DNS of other guests

Discussions related to using VirtualBox on Windows hosts.
Post Reply
phil-c
Posts: 13
Joined: 18. Dec 2019, 13:14

NATNetwork resolve DNS of other guests

Post 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.
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows, Linux

Re: NATNetwork resolve DNS of other guests

Post 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.
phil-c
Posts: 13
Joined: 18. Dec 2019, 13:14

Re: NATNetwork resolve DNS of other guests

Post 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.
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: NATNetwork resolve DNS of other guests

Post by fth0 »

VirtualBox offers some special DNS settings. You can read about them in 9.8. Fine Tuning the Oracle VM VirtualBox NAT Engine.
BillG
Volunteer
Posts: 5106
Joined: 19. Sep 2009, 04:44
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows 10,7 and earlier
Location: Sydney, Australia

Re: NATNetwork resolve DNS of other guests

Post 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.
Last edited by BillG on 1. Nov 2020, 08:22, edited 1 time in total.
Bill
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: NATNetwork resolve DNS of other guests

Post 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.
phil-c
Posts: 13
Joined: 18. Dec 2019, 13:14

Re: NATNetwork resolve DNS of other guests

Post 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.
Post Reply