No hostname resolution in bridged mode with CentOS 6.7
Posted: 21. Nov 2015, 00:53
Hi,
I am using VirtualBox 5.0.8 on a Windows 7 host to have multiple guest Linux distros for test purposes. Actually, I am using Vagrant to set them up, but I guess that is not relevant to the problem.
Each guest has a NIC1 of NAT type, and a NIC2 of bridge type. I'm not sure why that is done, I am not defining any NICs in the Vagrantfile, and what I want to use is the bridge type NIC.
The bridge type NICs in all guests properly get their IPv4 addresses from a DHCP server in the external network, and all are reachable from the host system by IP address.
However, some of the guests are not reachable by their hostname, and that is the problem I'd like to discuss here.
For example, guests with Ubuntu 14.04, Debian 8.1 and CentOS 7.1 are reachable by hostname, but a guest with CentOS 6.7 is not. That is entirely repeatable, e.g. when I re-provision the guest. Also, disabling the NAT type NIC1 does not help.
On my DHCP server (a Fritz!Box 7490), I can see that the three guests for which hostname access works, are shown with their hostnames in the list of known network devices, and the guest for which hostname access does not work, is shown just with its IP address.
It seems to me the problem is that the CentOS 6.7 guest does not provide its hostname to the DHCP server or DNS server (the Fritz Box is also defined as a DNS server for the external network interface of the Windows host, its DHCP and DNS servers are on 192.168.0.1, netmask 255.255.0.0, it hands out IP addresses in the 192.168.0.20-200 range).
-> Is that a reasonable suspicion, and if so, how can I get CentOS 6.7 to register its hostname?
-> The "VirtualBox Host-Only Ethernet Adapter" defined on the Windows host has its DHCP server enabled on 192.168.56.100, netmask 255.255.255.0. Also, I have read somewhere that VirtualBox has a DNS server built-in. Just out of curiosity, what are these DHCP and DNS servers used for?
Andy
I am using VirtualBox 5.0.8 on a Windows 7 host to have multiple guest Linux distros for test purposes. Actually, I am using Vagrant to set them up, but I guess that is not relevant to the problem.
Each guest has a NIC1 of NAT type, and a NIC2 of bridge type. I'm not sure why that is done, I am not defining any NICs in the Vagrantfile, and what I want to use is the bridge type NIC.
The bridge type NICs in all guests properly get their IPv4 addresses from a DHCP server in the external network, and all are reachable from the host system by IP address.
However, some of the guests are not reachable by their hostname, and that is the problem I'd like to discuss here.
For example, guests with Ubuntu 14.04, Debian 8.1 and CentOS 7.1 are reachable by hostname, but a guest with CentOS 6.7 is not. That is entirely repeatable, e.g. when I re-provision the guest. Also, disabling the NAT type NIC1 does not help.
On my DHCP server (a Fritz!Box 7490), I can see that the three guests for which hostname access works, are shown with their hostnames in the list of known network devices, and the guest for which hostname access does not work, is shown just with its IP address.
It seems to me the problem is that the CentOS 6.7 guest does not provide its hostname to the DHCP server or DNS server (the Fritz Box is also defined as a DNS server for the external network interface of the Windows host, its DHCP and DNS servers are on 192.168.0.1, netmask 255.255.0.0, it hands out IP addresses in the 192.168.0.20-200 range).
-> Is that a reasonable suspicion, and if so, how can I get CentOS 6.7 to register its hostname?
-> The "VirtualBox Host-Only Ethernet Adapter" defined on the Windows host has its DHCP server enabled on 192.168.56.100, netmask 255.255.255.0. Also, I have read somewhere that VirtualBox has a DNS server built-in. Just out of curiosity, what are these DHCP and DNS servers used for?
Andy