Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Gateway runs dns, and the command dig @ returns valid ip addresses, so dns is working and reachable.

The command tracepath returns gethostbyname2: Host name lookup failure.

The command tracepath ( yields valid results, so the default route is set up correctly.

The command route -n outputs:

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface         UG    100    0        0 eth0   U     0      0        0 eth0

And the applicable portion of /etc/network/interfaces reads:

auto eth0
iface eth0 inet static

No firewalls are currently running.

I would think, given these settings, that tracepath would contact for dns information, which is verified to be working and reachable.

What should I do next to find out why the tracepath command returns gethostbyname2: Host name lookup failure?

Edit (more info)

/etc/resolv.conf is empty. Ubuntu 12.04 uses a new subsystem, resolvconf, that autogenerates resolv.conf data in /etc/resolvconf/resolv.conf.d/*.

/etc/resolvconf/resolv.conf.d/original contains:


All other resolv.conf.d files (head and base)are empty.

/etc/nsswitch.conf contains:

    passwd:         compat
    group:          compat
    shadow:         compat

    hosts:          files dns
    networks:       files

    protocols:      db files
    services:       db files
    ethers:         db files
    rpc:            db files

    netgroup:       nis

/etc/hosts contains:       localhost       hostname

    # The following lines are desirable for IPv6 capable hosts
    ::1     ip6-localhost ip6-loopback
    fe00::0 ip6-localnet
    ff00::0 ip6-mcastprefix
    ff02::1 ip6-allnodes
    ff02::2 ip6-allrouters
share|improve this question
What's in your /etc/resolv.conf and /etc/nsswitch.conf for hosts:? – Ladadadada Mar 4 '13 at 22:41
The info is added to the question. – David Mar 4 '13 at 23:18
What nameserver do your lookups come from if you remove the @ from your dig? The next step will be to tcpdump -n port 53 while doing the above failing commands. – Ladadadada Mar 5 '13 at 7:29
A nameserver was not being contacted. That was the really weird thing to me. The problem is now solved. Thanks! – David Mar 5 '13 at 19:06
up vote 1 down vote accepted

I'm not very familiar with the resolv.conf.d version, but I believe you should put the lookup settings in /etc/resolv/resolv.conf.d/base instead of /etc/resolv/resolv.conf.d/original

share|improve this answer
That did it! And it lead me to another answer, which I'll post in addition. Thanks! – David Mar 5 '13 at 18:55

The accepted answer, where the nameserver directive goes in the /etc/resolv/resolv.conf.d/base file is one way of managing the nameserver setting in ubuntu's new resolvconf subsystem, but there is also another way, which I had been attempting with my config.

Nameservers can also be set in the /etc/network/interfaces file using the dns-nameservers directive.

My problem was a typo! I had written dns-nameservers as "dns-servers".

I've verified both the accepted answer and this answer to work.

share|improve this answer
Thanks for writing this, it'll be useful when we do our next upgrade here! – Jenny D Mar 6 '13 at 7:40

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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