I have installed three Linuxes on same laptop and same VirtualBox and this is my success ratio with DNS:
- HortonWorks & CentOS. Worked for 5 minutes and never after that again. VM image reinstallation from scratch didn't help.
- Talend, MapR & CentOS. Worked fine for a couple of days and then stopped working. First it stopped working everywhere except Firefox, and a few hours later Firefox stopped working as well. I know that Firefox has its own DNS cache, so I suppose it cached DNS server name or something like that for a while as well as it worked even for sites that I had never browsed.
- Cloudera & RHEL/RedHat works perfectly all the time (with this issue, but it has some other issues).
/etc/hosts maintenance works differently also:
- HortonWorks CentOS - works fine, no issues with it. This is the only way I get anything done despite the DNS issue.
- Talend CentOS - it resets file immediately back. When I update the file with vi, vi complains that someone has changed the file already when I get to the point of saving my changes. And what "someone" is doing there is that this "nice" service is reverting it back constantly.
I haven't yet tried to revert back to previous snapshot with Talend CentOS as I am hoping to understand first what I did "wrong", so that I wouldn't repeat the same mistake and break the DNS service again. This is assuming that there is some logic as to when this gets broken and when it works.
I am using the only option that works at all with VirtualBox network settings: NAT. And yes, I do try to turn it off and on back again to fix it. And that helps to occasional problems when the Windows host has got a new network address (= every morning).
DHCP client id is empty in settings, so it should be default:
/sbin/dhclient -d -4 -sf /usr/libexec/nm-dhcp-client.action -pf /var/run/dhclient-eth0.pid -lf /var/lib/dhclient/dhclient-13e5cc85-010e-45e6-0000-f9b4015d5abc-eth0.lease -cf /var/run/nm-dhclient-eth0.conf eth0
DHCP settings (System Preferences --> Network Connections --> System eth0 --> Edit... --> IPv4 & IPv6) are by default set to (fully) automatic. I also tested to set with the localhost IP address found from
/etc/hosts, DNS & gateway that I found with
ipconfig -all (in Windows host) and with netmask 255.255.255.0. But that didn't help.
If I kill DHCP
kill 20610, then DNS works for perhaps 10 minutes until it fails again.
I found a clue. When DNS functions properly then
/etc/resolv.conf file contents are
# Generated by NetworkManager search local # No nameservers found; try putting DNS servers into your # ifcfg files in /etc/sysconfig/network-scripts like so: # # DNS1=xxx.xxx.xxx.xxx # DNS2=xxx.xxx.xxx.xxx # DOMAIN=lab.foo.com bar.foo.com
And when DNS is broken, then same file has
Googling it up explained that this is DNS server of Google themselves and that is often used as a backup DNS server. So some service decides to use that address as DNS server for whatever reason and that doesn't work from my Windows host either. It is apparently blocked by the company I work in.
Copied/moved this discussion to CentOS site: https://www.centos.org/forums/viewtopic.php?f=16&t=47539&p=202100#p202100