I ran into what was probably the strangest error I have ever encountered as a Linux admin. I created a fresh CentoOS 6 virtual machine (VM) using VirtualBox on my OS X Mountain Lion system. To my great surprise, I was only able to access Google and a handful of other web sites from Firefox in the VM. I assumed that there was an issue with the networking of the VM, but after several frustrating hours of checking my setup I realized that the network in the VM was working fine. I was able to ping any web site by name on the command line, so clearly DNS was working. I could navigate to http://www.google.com and perform searches, but clicking on most links resulted in the browser waiting forever. I could navigate to any site by IP, although the sites didn’t always load correctly (such as centos.org).
I found a Fedora discussion thread by a user who was only able to browse to Google. He solved the problem by making several changes, but I found that I only had to modify one thing to get it working. Go to the menu System -> Preferences -> Network Connections. Double-click on System eth0, go to the IPV4 Settings tab and configure as shown in the screenshot below. The IP addresses are for Google’s public DNS servers. For reasons I do not understand, Firefox was unable to get the DNS servers that were automatically populated by DHCP, but it was able to get these DNS servers. Why was Firefox able to resolve a few hostnames without DNS? I’m not sure, but I wonder if it has anything to do with the built-in Google search bar.
In the forum link above, the user also had to set the MTU to 1400, but I didn’t have to change this setting.