I have a DNS problem in a KVM guest running Ubuntu 14.04.1 LTS. The host is the same. The host has a bridge network configured since I want to see the guest on my network.

So far, I can see the guest on my network. I can ping it. The guest can ping out without problem. The guest has a static IP configured. I can ping external DNS servers etc.

The problem is that DNS just does not work on the guest. I cannot resolve anything either using nslookup or host commands.

The host does not have any DNS issues.

So I am baffled as to why DNS does not work but networking does.

Here is the host /etc/network/interfaces file:

# 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
iface lo inet loopback

# The primary network interface
auto em1
iface em1 inet manual

auto br0
iface br0 inet static
   bridge_ports em1
   bridge_stp off
   bridge_fd 0
   bridge_maxwait 0

Here is the ifconfig of the guest:

eth0      Link encap:Ethernet  HWaddr 00:16:3e:7a:56:f5
          inet addr:  Bcast:  Mask:
          inet6 addr: fe80::216:3eff:fe7a:56f5/64 Scope:Link
          RX packets:215 errors:0 dropped:17 overruns:0 frame:0
          TX packets:58 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:17545 (17.5 KB)  TX bytes:7237 (7.2 KB)

lo        Link encap:Local Loopback
          inet addr:  Mask:
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:52 errors:0 dropped:0 overruns:0 frame:0
          TX packets:52 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:4568 (4.5 KB)  TX bytes:4568 (4.5 KB)

Any suggestions?


The resolver looks in /etc/resolv.conf for nameservers, not /etc/network/interfaces. Create /etc/resolv.conf containing:


Manual pages:

  • 1
    Technically I should not edit /etc/resolv.conf but rather /etc/resolvconf/resolv.conf.d/base and then perform sudo resolvconf -u. But I get your meaning. This however does not resolve the issue as I was specifying the server in nslookup before. But thanks anyways. I still have the DNS issue. – garthoid Jan 17 '15 at 1:21
  • @garthoid nslookup example.com times out for me (whereas nslookup example.com for Google DNS works). Is this some ISP DNS server not accessible to the outside world? – Lekensteyn Jan 17 '15 at 10:15
  • is the DNS servers for my ISP. For example, on my host I can nslookup askubuntu.com and it successfully returns the domain information. However on my guest it fails. Also, nslookup askubuntu.com times out on my guest yet I can ping – garthoid Jan 17 '15 at 14:56

Bingo! I found it. It took some faffing about (a technical term) but I was able to eventual get the brain working.

Here is what I know. Networking based on IP address is fine. I can ping out and ping in. So TCP generally is not a problem in this bridged KVM guest. Yet dns, regardless of the server was an issue. Why? If networking is generally fine but a particular service is having an issue then I should have naturally decided to look at the firewall.

In this case, the host firewall was blocking DNS requests from the guess. Since this is an internal system disabling the host firewall with:

sudo ufw disable

and opening up iptables:

sudo iptables -F
sudo iptables -X
sudo iptables -P INPUT ACCEPT
sudo iptables -P FORWARD ACCEPT
sudo iptables -P OUTPUT ACCEPT

...resolved my issue. Thanks for your responses.

  • Make sure to mark this as the answer, so people can refer to it at a later point, and have an easy visual cue. =P – Omio Jan 17 '15 at 15:35
  • 1
    I will have to wait for tomorrow to accept my own answer. It will not allow me to accept it today. Cooling off period? :-) – garthoid Jan 17 '15 at 16:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.