I'm having issues with one of my servers taking a long time to look up host names.
This is an Ubuntu 12.04 box, so I've tried following the new
/etc/network/interfaces file, I defined my name servers like this:
auto eth0 iface eth0 inet static address someaddress netmask 255.255.255.0 gateway 126.96.36.199 dns-nameservers 188.8.131.52 184.108.40.206
/etc/resolv.conf, I see these name servers, like this:
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8) # DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN nameserver 220.127.116.11 nameserver 18.104.22.168
On another box, I edited the
resolv.conf directly as directed by my hosts' setup help files. It looks like this:
domain members.linode.com search members.linode.com nameserver 22.214.171.124 nameserver 126.96.36.199 options rotate
This second box has no issues with host name look ups and responds quite quickly.
Could not having the
search directives make my look ups slow? By slow, I mean it's taking anywhere from 5 to 15 seconds to find the IP address of a host.
If I do a
time dig @188.8.131.52 www.google.com I get a response quickly with a "real" time of .170 seconds.
If I do a
ping google.com I get a real time of 10.078 seconds, even if I quit the ping after one response. Like this:
time ping google.com PING google.com (184.108.40.206) 56(84) bytes of data. ^C64 bytes from iad23s06-in-f5.1e100.net (220.127.116.11): icmp_req=1 ttl=54 time=34.2 ms --- google.com ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 34.291/34.291/34.291/0.000 ms real 0m10.078s user 0m0.001s sys 0m0.005s