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)
Change History (12)
by , 9 years ago
| Attachment: | Centos 7.1 ApplinX 9.8.vbox added |
|---|
by , 9 years ago
by , 9 years ago
| Attachment: | VirtualBox.xml added |
|---|
by , 9 years ago
| Attachment: | centos7.pcap added |
|---|
comment:1 by , 9 years ago
| Component: | network → network/NAT |
|---|
follow-up: 3 comment:2 by , 9 years ago
by , 9 years ago
| Attachment: | resolv.guest.conf added |
|---|
resolv.conf virtual machine guest OS (no DNS server information)
by , 9 years ago
| Attachment: | VBoxSVC.log added |
|---|
comment:3 by , 9 years ago
Replying to vushakov:
What's in your
resolv.conf? Please, can you also attachVBoxSVC.log?
Files attached.
comment:4 by , 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 , 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.


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