Networking Forums

Networking Forums > Computer Networking > Linux Networking > nslookup works but ping does'nt !?

Reply
Thread Tools Display Modes

nslookup works but ping does'nt !?

 
 
Mark
Guest
Posts: n/a

 
      10-11-2006, 09:05 PM
I've just added a Linux box to my home network but I'm having trouble
getting it to resolve >local< DNS addresses properly.

What seems to happen is that if I use nslookup to lookup a local ( that
is on the same network ) name, it works, but if I try and ping it by
name it fails. I can ping local machines by ip addresss so it's not a
firewall issue or similar

Non-local names resolve ok, as I have set them to be forwarded to my
host providers DNS server.






Mark

 
Reply With Quote
 
 
 
 
Moe Trin
Guest
Posts: n/a

 
      10-12-2006, 02:54 AM
On Wed, 11 Oct 2006, in the Usenet newsgroup comp.os.linux.networking, in
article <003d01c6ed79$23837000$0101a8c0@local>, Mark wrote:

>This is a multi-part message in MIME format.


[grumble]

>What seems to happen is that if I use nslookup to lookup a local ( that
>is on the same network ) name, it works, but if I try and ping it by
>name it fails. I can ping local machines by ip addresss so it's not a
>firewall issue or similar


The difference between the way nslookup (and dig, and dnsquery, and host)
work and the way applications like ping work is that the applications
consult /etc/host.conf (old stuff) or /etc/nsswitch.conf (newer applications
generally using glibc2), and follow the sequence there, while the DNS query
tools ignore that file, and ONLY consult name servers.

[compton ~]$ grep host /etc/host.conf /etc/nsswitch.conf
/etc/host.confrder hosts,bind
/etc/nsswitch.conf:hosts: files nisplus nis dns
[compton ~]$

Here, /etc/host.conf directs the resolver to look at "hosts" (the /etc/hosts
file) before making a DNS query. The line in /etc/nsswitch.conf directs the
resolver to "files" (again, /etc/hosts), then to NIS+ (not often used), NIS
(the 'yp' commands - again not often used), before trying DNS.

Thus, what's in your hosts file? Is it getting sidetracked there?

Another thing _might_ be nasty effects of the helper keywords in
/etc/resolv.conf - the 'domain' or 'search' terms, neither of which do _I_
recommend. See the 'man 5 resolver' man page and note the cautions.

If all else fails, run tcpdump listening on the appropriate network
interface, and compare the "dialog" between your computer and the name
server as you use nslookup and an application like ping.

>Non-local names resolve ok, as I have set them to be forwarded to my
>host providers DNS server.


Check also what is listed in /etc/resolv.conf, remembering that the
resolver believes the first answer it gets - even if that answer is
"I don't know" (NXDOMAIN).

>------=_NextPart_000_0039_01C6ED81.85431D10
>Content-Type: text/html;


And fix the browser - HTML does NOT belong on Usenet.

Old guy
 
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Ping does not resolve, nslookup does, DNS queries end up externall Mike. Windows Networking 3 03-06-2008 06:18 PM
Nslookup succeeds, but ping fails to resolve hostname Curt McNamee Windows Networking 1 11-07-2006 03:04 PM
Dig and nslookup resolve; ping doesn't Mark Tunnell Linux Networking 1 07-14-2005 07:59 PM
LMHOSTS not working for NSLOOKUP and PING Carol Chisholm Windows Networking 1 08-06-2004 06:38 PM
WWW, telnet, everything works. Except ping. Patrick Linux Networking 8 01-17-2004 07:24 AM



1 2 3 4 5 6 7 8 9 10 11