DNS Resolution Problem

Issues related to configuring your network
nikko_bosatsu
Posts: 4
Joined: 2007/06/05 09:57:12
Location: Jakarta, Indonesia

DNS Resolution Problem

Post by nikko_bosatsu » 2007/06/05 10:10:53

Hi All , my computer can not resolve address from DNS server.
I use CentOS 4.4. This computer used as Web Server and DHCP server, no DNS service installed on this computer.
For DNS server I use my ISP DNS server. Other network function work normal

Here some output when I try to ping centos.org server

[raiden@shiro ~]$ ping centos.org
ping: unknown host centos.org
[raiden@shiro ~]$ nslookup centos.org
Server: 202.169.33.220
Address: 202.169.33.220#53

Non-authoritative answer:
Name: centos.org
Address: 72.232.194.162

[raiden@shiro ~]$ ping 72.232.194.162
PING 72.232.194.162 (72.232.194.162) 56(84) bytes of data.
64 bytes from 72.232.194.162: icmp_seq=0 ttl=46 time=258 ms
64 bytes from 72.232.194.162: icmp_seq=1 ttl=42 time=252 ms
64 bytes from 72.232.194.162: icmp_seq=2 ttl=46 time=259 ms

--- 72.232.194.162 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2002ms
rtt min/avg/max/mdev = 252.526/256.884/259.202/3.111 ms, pipe 2

Thanks for the help...
8-)

gerald_clark
Posts: 10642
Joined: 2005/08/05 15:19:54
Location: Northern Illinois, USA

Re: DNS Resolution Problem

Post by gerald_clark » 2007/06/05 13:23:12

You just proved that it can.
nslookup returned the correct address, so your computer
did resolve the address from a DNS server.

Now, why did it not resolve for ping?
What is the contents of /etc/resolv.conf?

nikko_bosatsu
Posts: 4
Joined: 2007/06/05 09:57:12
Location: Jakarta, Indonesia

Re: DNS Resolution Problem

Post by nikko_bosatsu » 2007/06/06 01:03:38

Here is the cantent of my resolv.conf and host.conf

[raiden@shiro ~]$ cat /etc/resolv.conf
nameserver 202.169.33.220
nameserver 202.169.33.222


that make me little dizzy to, because this not only happen for ping only but also for yum, and other application that need to perform DNS lookup.

Thanks for the Help :)

michaelnel
Posts: 1478
Joined: 2006/05/29 16:50:11
Location: San Francisco, CA

Re: DNS Resolution Problem

Post by michaelnel » 2007/06/06 16:57:19

You should have a "search" or "domain" statement in your /etc/resolv.conf too.

foxb
Posts: 1927
Joined: 2006/04/20 19:03:33
Location: Montreal/QC

Re: DNS Resolution Problem

Post by foxb » 2007/06/06 17:27:56

Do you have firewall somewhere?

nikko_bosatsu
Posts: 4
Joined: 2007/06/05 09:57:12
Location: Jakarta, Indonesia

Re: DNS Resolution Problem

Post by nikko_bosatsu » 2007/06/07 04:17:43

@michaelnel
I think the "search domain_name" is not the cause, I already try added to resolv.conf, but it still not work.

@foxb
The firewall is not the problem, because other computers can perform query to DNS server on my resolv.conf, and also there are no policies on the firewall that block DNS query from spesific computer/IP.

Thanks All :-D

Maybe if this still not solved then I just fresh install and upgrade to CentOS 5 :idea:

foxb
Posts: 1927
Joined: 2006/04/20 19:03:33
Location: Montreal/QC

Re: DNS Resolution Problem

Post by foxb » 2007/06/07 13:47:39

It is really weird problem....

Maybe you can add centos.org in hosts file and try again if it does not work again probably you need to reinstall.

K_Frye
Posts: 425
Joined: 2005/07/13 01:48:35
Location: Canada

DNS Resolution Problem

Post by K_Frye » 2007/06/07 18:11:35

[quote]
nikko_bosatsu wrote:
@michaelnel
I think the "search domain_name" is not the cause, I already try added to resolv.conf, but it still not work.

@foxb
The firewall is not the problem, because other computers can perform query to DNS server on my resolv.conf, and also there are no policies on the firewall that block DNS query from spesific computer/IP.

Thanks All :-D

Maybe if this still not solved then I just fresh install and upgrade to CentOS 5 :idea:[/quote]

Try booting with something like Knoppix (or even hook up a Windows PC) and see if you have the same problem.

michaelnel
Posts: 1478
Joined: 2006/05/29 16:50:11
Location: San Francisco, CA

Re: DNS Resolution Problem

Post by michaelnel » 2007/06/07 19:52:07

[quote]
nikko_bosatsu wrote:
@michaelnel
I think the "search domain_name" is not the cause, I already try added to resolv.conf, but it still not work.[/quote]

I didn't think it was the cause either, but it's an error to not have it in the file. It won't cause this problem, but it will cause others.

Look at other resolver-related config files like /etc/nsswitch.conf and /etc/host.conf too, and make sure they are set up right. If all that checks out I think at this point I would be using lower level tools like strace and tcpdump or wireshark to see what's going on.

What nags at me about this is that I have seen it before, where nslookup can resolve but apps such as ping and web browsers that use the resolver library cannot, and it came down to some difference in the way nslookup works compared to the others. Unfortunately I am old and senile and can't remember, and although I just spent some time googling for it couldn't find it there either.

That's why I'm thinking strace and wireshark might be informative.

michaelnel
Posts: 1478
Joined: 2006/05/29 16:50:11
Location: San Francisco, CA

Re: DNS Resolution Problem

Post by michaelnel » 2007/06/07 21:57:35

sb3:/usr/bin# ldd nslookup
libdns.so.16 => /usr/lib/libdns.so.16 (0x00b4e000)
libisc.so.7 => /usr/lib/libisc.so.7 (0x00111000)
libcrypto.so.4 => /lib/libcrypto.so.4 (0x00148000)
libnsl.so.1 => /lib/libnsl.so.1 (0x00d79000)
libpthread.so.0 => /lib/tls/libpthread.so.0 (0x00231000)
libc.so.6 => /lib/tls/libc.so.6 (0x00289000)
libgssapi_krb5.so.2 => /usr/lib/libgssapi_krb5.so.2 (0x00c5d000)
libkrb5.so.3 => /usr/lib/libkrb5.so.3 (0x00dad000)
libcom_err.so.2 => /lib/libcom_err.so.2 (0x00243000)
libk5crypto.so.3 => /usr/lib/libk5crypto.so.3 (0x004c5000)
libresolv.so.2 => /lib/libresolv.so.2 (0x00246000)
libdl.so.2 => /lib/libdl.so.2 (0x00259000)
libz.so.1 => /usr/lib/libz.so.1 (0x0025d000)
/lib/ld-linux.so.2 (0x004ef000)

sb3:/usr/bin# ldd /bin/ping
libresolv.so.2 => /lib/libresolv.so.2 (0x00593000)
libc.so.6 => /lib/tls/libc.so.6 (0x00233000)
/lib/ld-linux.so.2 (0x00601000)

Note that they both use libresolv, but nslookup also uses libdns.

Can /usr/bin/host resolve on your machine? It seems to use the same libs as nslookup.

Post Reply

Return to “CentOS 4 - Networking Support”