I have two virtual machines setup in VirtualBox. One is acting as a DNS server, and has two network adapters attached to it:
- Adapter 1: Internal Network (intnet)
- Adapter 2: Bridged adapter (wlan0)
The DNS server is setup using Debian and DNSMasq. DNSMasq is configured to act as DHCP server and cache DNS queries. From the DNS server itself, I can ping google.com without a problem.
My second virtual machine is setup using CentOS 6.5, and has the same two adapters, however this time the bridged adapter is currently disabled. The CentOS virtual machine detects the DHCP server fine, and is given an address (192.168.5.121). From CentOS, I can ping the DNS server at 192.168.5.10, and vice-versa, the DNS server can ping the CentOS machine.
However, when I try to ping google.com from the CentOS guest, I receive:
--- google.co.uk ping statistics --- 3 packets transmitted, 0 received, 100% packet loss, time 2523ms
I can however, dig the google.co.uk fine from CentOS:
[developer@centos ~]$ dig google.co.uk ; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.17.rc1.el6_4.6 <<>> google.co.uk ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 31867 ;; flags: qr rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 0, ADDITIONAL: 0 ;; QUESTION SECTION: ;google.co.uk. IN A ;; ANSWER SECTION: google.co.uk. 260 IN A 18.104.22.168 google.co.uk. 260 IN A 22.214.171.124 google.co.uk. 260 IN A 126.96.36.199 ;; Query time: 3 msec ;; SERVER: 192.168.5.10#53(192.168.5.10) ;; WHEN: Sun Feb 9 14:18:51 2014 ;; MSG SIZE rcvd: 78
My /etc/resolv.conf on CentOS is set to use 192.168.5.10 (the DNS server) as a nameserver.
The DNS server's /etc/network/interfaces file looks like this:
# This file describes the network interfaces available on your system # and how to activate them. For more information, see interfaces(5). # The loopback network interface auto lo eth1 eth0 iface lo inet loopback # The primary network interface (VM Network) allow-hotplug eth0 iface eth0 inet static address 192.168.5.10 gateway 192.168.1.254 dns-nameservers 127.0.0.1 188.8.131.52 # Secondary Interface (Bridged adapter) iface eth1 inet dhcp
If anybody could offer any advice as to why the CentOS virtual machine fails to connect to google.co.uk, I would be extremely grateful!
Thanks in advance!