VirtualBox

Opened 9 years ago

Last modified 9 years ago

#14414 new defect

No DNS server information on DHCP enabled NATNetworks

Reported by: jacksonfoz Owned by:
Component: network/NAT Version: VirtualBox 5.0.0
Keywords: dns dhcp natnetwork Cc:
Guest type: Linux Host type: Linux

Description

I've configured a NATNetwork with DHCP enabled:

NetworkName:    NatNetwork
IP:             10.0.3.1
Network:        10.0.3.0/24
IPv6 Enabled:   No
IPv6 Prefix:    
DHCP Enabled:   Yes
Enabled:        Yes
loopback mappings (ipv4)
        127.0.0.1=2

It created a DHCP server configuration like this:

NetworkName:    NatNetwork
IP:             10.0.3.3
NetworkMask:    255.255.255.0
lowerIPAddress: 10.0.3.4
upperIPAddress: 10.0.3.254
Enabled:        Yes

When the VM is started it requests the IP address to DHCP server. On the DHCP response (DHCP ACK package) there is no DNS information, but there is the Domain Name (DNS suffix).

If I manually configure the DNS in the virtual machine to 10.0.3.1 the name resolution works.

Attachments (7)

Centos 7.1 ApplinX 9.8.vbox (8.6 KB ) - added by jacksonfoz 9 years ago.
VBox.log (110.0 KB ) - added by jacksonfoz 9 years ago.
VirtualBox.xml (3.8 KB ) - added by jacksonfoz 9 years ago.
centos7.pcap (3.0 KB ) - added by jacksonfoz 9 years ago.
resolv.guest.conf (253 bytes ) - added by jacksonfoz 9 years ago.
resolv.conf virtual machine guest OS (no DNS server information)
resolv.conf (186 bytes ) - added by jacksonfoz 9 years ago.
Host machine resolv.conf
VBoxSVC.log (2.8 KB ) - added by jacksonfoz 9 years ago.

Download all attachments as: .zip

Change History (12)

by jacksonfoz, 9 years ago

Attachment: Centos 7.1 ApplinX 9.8.vbox added

by jacksonfoz, 9 years ago

Attachment: VBox.log added

by jacksonfoz, 9 years ago

Attachment: VirtualBox.xml added

by jacksonfoz, 9 years ago

Attachment: centos7.pcap added

comment:1 by Valery Ushakov, 9 years ago

Component: networknetwork/NAT

comment:2 by Valery Ushakov, 9 years ago

What's in your resolv.conf? Please, can you also attach VBoxSVC.log?

by jacksonfoz, 9 years ago

Attachment: resolv.guest.conf added

resolv.conf virtual machine guest OS (no DNS server information)

by jacksonfoz, 9 years ago

Attachment: resolv.conf added

Host machine resolv.conf

by jacksonfoz, 9 years ago

Attachment: VBoxSVC.log added

in reply to:  2 comment:3 by jacksonfoz, 9 years ago

Replying to vushakov:

What's in your resolv.conf? Please, can you also attach VBoxSVC.log?

Files attached.

comment:4 by Valery Ushakov, 9 years ago

You resolver on the host is at 127.0.1.1 which not mapped by default to any address in the NAT Network address space. You can add a mapping with

VBoxManage natnetwork modify --netname "NatNetwork" --loopback-4 "127.0.1.1=254"

which will map the loopback address 127.0.1.1 to (in your case) 10.0.3.254.

You will also want to prevent DHCP from using this address. Unfortunately you cannot just change the lower/upper IP parameter alone and have to specify everything with

VBoxManage dhcpserver modify --netname "NatNetwork" --ip 10.0.3.3 --netmask 255.255.255.0 --lowerip 10.0.3.4 --upperip 10.0.3.253

comment:5 by jacksonfoz, 9 years ago

These commands made it work as expected. The DNS in VM are now set to 10.0.3.254.

Manually setting resolv.conf to 10.0.3.1 (NatNetwork default gateway) also works. And it requires less configuration (no loopback mapping). In the first moment I was expecting this should be the DNS address sent with DHCP.

Maybe this could be the default behavior when the DNS address is a loopback address.

Thank you.

Note: See TracTickets for help on using tickets.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette