[CentOS] inconsistent DNS results - ping vs dig vs nslookup

Devin Reade gdr at gno.org
Wed Jun 22 23:14:06 UTC 2011


--On Wednesday, June 22, 2011 03:30:18 PM -0500 Robert Henrichs
<centos at henrichs.biz> wrote:

> root at pbx:~ $ cat /etc/resolv.conf
> search isp.com
>    nameserver 8.8.4.4
>    nameserver 216.146.36.36
>    nameserver 8.8.8.8

Get rid of the leading whitespace if it actually exists in that file.
It shouldn't make a difference, but who knows.

BTW, you don't need to reboot.

> root at pbx:~ $ ping www.yahoo.com
> ping: unknown host www.yahoo.com

Try a trailing dot on the FQDN and see if it makes a difference.
It shouldn't with ping, but should always be used with dig:

   ping www.yahoo.com.

The trailing dot changes the lookup algorithm a bit.

You could also do a
    RES_OPTIONS="debug"
    export RES_OPTIONS
    ping www.yahoo.com.
to try to figure things out.

Devin




More information about the CentOS mailing list