Google Groups unterstützt keine neuen Usenet-Beiträge oder ‑Abos mehr. Bisherige Inhalte sind weiterhin sichtbar.

How are ping and nslookup different?

0 Aufrufe
Direkt zur ersten ungelesenen Nachricht

Mitchell Burko

ungelesen,
18.10.1999, 03:00:0018.10.99
an
Yes I'm a newbie, but get this. Ping resolves names in /etc/hosts and
nslookup doesn't. What's up with that?

Using nslookup, I can get IPs and host names for public hosts (i.e.
cbs.com). I cannot get local names to resolve (i.e. yogi to
192.168.0.1). Reverse lookup also does not work with nslookup (i.e.
192.168.0.1 to reverse lookup to yogi). Public IP reverse lookup
correctly.

I'm using suse 6.2. the hosts line that should work is
192.168.0.1 yogi

So, how do ping and nslookup differ? What should I be doing
differently.

Thanks in advance, Mitch
mbu...@logicalsys.com


Quiney, Philip (EXCHANGE:HAL02:HM10)

ungelesen,
18.10.1999, 03:00:0018.10.99
an
For nslookup to work for local addresses you need to be running named on
a machine which knows all the local addresses. You can then set your
/etc/resolv.conf file to point to your local machine (itself?) running
named - also change dns setting on any other machines locally to use
your 'named' machine.

You will need to set up your named to query a public server for unknown
(ie external) names. I use this to get 'diald' to bring up the modem
link to my ISP.

HTH

Regards

Phil Q

--

Phil Quiney CSIP Demonstrator
pqu...@nortelnetworks.com Nortel Networks,
Telephone: +44 (1279) 402363 London Rd, Harlow,
Fax: +44 (1279) 402885 Essex CM17 9NA,
United Kingdom.

"This message may contain information proprietary to Northern
Telecom so any unauthorised disclosure, copying or distribution
of its contents is strictly prohibited."

Mitchell Burko

ungelesen,
18.10.1999, 03:00:0018.10.99
an
On Mon, 18 Oct 1999 08:48:51 +0100, "Quiney, Philip
(EXCHANGE:HAL02:HM10)" <pqu...@nortelnetworks.com> wrote:

>Mitchell Burko wrote:
>>
>> Yes I'm a newbie, but get this. Ping resolves names in /etc/hosts and
>> nslookup doesn't. What's up with that?
>>
>> Using nslookup, I can get IPs and host names for public hosts (i.e.
>> cbs.com). I cannot get local names to resolve (i.e. yogi to
>> 192.168.0.1). Reverse lookup also does not work with nslookup (i.e.
>> 192.168.0.1 to reverse lookup to yogi). Public IP reverse lookup
>> correctly.
>>
>> I'm using suse 6.2. the hosts line that should work is
>> 192.168.0.1 yogi
>>
>> So, how do ping and nslookup differ? What should I be doing
>> differently.
>>
>For nslookup to work for local addresses you need to be running named on
>a machine which knows all the local addresses. You can then set your
>/etc/resolv.conf file to point to your local machine (itself?) running
>named - also change dns setting on any other machines locally to use
>your 'named' machine.
>
>You will need to set up your named to query a public server for unknown
>(ie external) names. I use this to get 'diald' to bring up the modem
>link to my ISP.
>

>Regards


>Phil Quiney CSIP Demonstrator
>pqu...@nortelnetworks.com Nortel Networks,

Thanks for the help!

If you have time to explain, what is hosts for and who uses it, and
who doesn't use it?

Coming from the land of Windows I expected hosts to be used for any
DNS resolving.

Thanks again, Mitch


Colin Watson

ungelesen,
18.10.1999, 03:00:0018.10.99
an
In article <380b11ec.1697216@news-server>,

Mitchell Burko <mbu...@logicalsys.com> wrote:
>On Mon, 18 Oct 1999 08:48:51 +0100, "Quiney, Philip
>(EXCHANGE:HAL02:HM10)" <pqu...@nortelnetworks.com> wrote:
>
>>For nslookup to work for local addresses you need to be running named on
>>a machine which knows all the local addresses. You can then set your
>>/etc/resolv.conf file to point to your local machine (itself?) running
>>named - also change dns setting on any other machines locally to use
>>your 'named' machine.
>>
>>You will need to set up your named to query a public server for unknown
>>(ie external) names. I use this to get 'diald' to bring up the modem
>>link to my ISP.
>
>Thanks for the help!
>
>If you have time to explain, what is hosts for and who uses it, and
>who doesn't use it?
>
>Coming from the land of Windows I expected hosts to be used for any
>DNS resolving.

Virtually any "normal" name resolution uses /etc/hosts before going to
the nameserver (though Netscape doesn't seem to, annoyingly ...), at
least if appropriately configured in /etc/host.conf. However, nslookup
doesn't because it is *explicitly* designed to query name servers.
That's its entire purpose in life.

--
Colin Watson [cjw44 at cam.ac.uk]
Trinity College, Cambridge, and Computer Science [riva.ucam.org]
"Then hast thou joined the ARPANET? / Oh come to me, my bankrupt boy!
Quick, call the NIC! Send RFCs! / He chortled in his joy." - RFC 527

Andrew Williams

ungelesen,
18.10.1999, 03:00:0018.10.99
an mbu...@logicalsys.com
The 'hosts' file has the same function as in the WinWorld and is used by
virtually everything. It has - however - nothing directly to do with dns.

If I want to reach (ping,ftp,telnet, whatever) host 'meanie', the file
'hosts' is looked at first (static resolution). If 'meanie' is not there and
dns (d=dynamic) is configured, the dns-server is looked at.

Samba has a couple of other lookups there as well (lmhosts and wins) but that
is because the smb protocols require this.

nslookup is an exception in that it is a command that specifically looks at a
dns-server, that is it's entire purpose.


Mitchell Burko wrote:

> On Mon, 18 Oct 1999 08:48:51 +0100, "Quiney, Philip
> (EXCHANGE:HAL02:HM10)" <pqu...@nortelnetworks.com> wrote:
>

> >Mitchell Burko wrote:
> >>
> >> Yes I'm a newbie, but get this. Ping resolves names in /etc/hosts and
> >> nslookup doesn't. What's up with that?
> >>
> >> Using nslookup, I can get IPs and host names for public hosts (i.e.
> >> cbs.com). I cannot get local names to resolve (i.e. yogi to
> >> 192.168.0.1). Reverse lookup also does not work with nslookup (i.e.
> >> 192.168.0.1 to reverse lookup to yogi). Public IP reverse lookup
> >> correctly.
> >>
> >> I'm using suse 6.2. the hosts line that should work is
> >> 192.168.0.1 yogi
> >>
> >> So, how do ping and nslookup differ? What should I be doing
> >> differently.
> >>

> >For nslookup to work for local addresses you need to be running named on
> >a machine which knows all the local addresses. You can then set your
> >/etc/resolv.conf file to point to your local machine (itself?) running
> >named - also change dns setting on any other machines locally to use
> >your 'named' machine.
> >
> >You will need to set up your named to query a public server for unknown
> >(ie external) names. I use this to get 'diald' to bring up the modem
> >link to my ISP.
> >

> >Regards
> >Phil Quiney CSIP Demonstrator
> >pqu...@nortelnetworks.com Nortel Networks,
>

> Thanks for the help!
>
> If you have time to explain, what is hosts for and who uses it, and
> who doesn't use it?
>
> Coming from the land of Windows I expected hosts to be used for any
> DNS resolving.
>

> Thanks again, Mitch

--
Mielipiteet omiani - Opinions personal, facts suspect, especially on my
http://home.germany.net/101/69082/samba.html
Simple Samba Solutions web page. ICQ 1722461
__________________________________________________________
| Fight Spam! Join EuroCAUCE: http://www.euro.cauce.org/ |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Colin Watson

ungelesen,
18.10.1999, 03:00:0018.10.99
an
In article <380B3674...@NoSpam.okay.net>,

Andrew Williams <andrew....@okay.net> wrote:
>The 'hosts' file has the same function as in the WinWorld and is used by
>virtually everything. It has - however - nothing directly to do with dns.
>
>If I want to reach (ping,ftp,telnet, whatever) host 'meanie', the file
>'hosts' is looked at first (static resolution). If 'meanie' is not there and
>dns (d=dynamic) is configured, the dns-server is looked at.

Actually, DNS stands for "Domain Name System" (RFC 1034).

>nslookup is an exception in that it is a command that specifically looks at a
>dns-server, that is it's entire purpose.

Last time I looked at a Windows box, I thought it did the same thing
there too? If not, I think it's probably broken ... film at 11 ...

--
Colin Watson [cj...@cam.ac.uk]


Trinity College, Cambridge, and Computer Science [riva.ucam.org]

"Ah, young webmaster ... Java leads to Shockwave. Shockwave leads to
RealAudio, and RealAudio leads to suffering." - Peter da Silva, ASR

Armand Welsh

ungelesen,
18.10.1999, 03:00:0018.10.99
an
> Using nslookup, I can get IPs and host names for public hosts (i.e.
> cbs.com). I cannot get local names to resolve (i.e. yogi to
> 192.168.0.1). Reverse lookup also does not work with nslookup (i.e.
> 192.168.0.1 to reverse lookup to yogi). Public IP reverse lookup
> correctly.

The problem here is twofold. One, the name you specified, yogi, is not a
fully qualified host name. it's missing the .domain.com part. because of
this, dns does not know how to resolve this. The solution is simple. Set
you local domain, and then when you ping a host w/o the domain part
specified, the name will be resolved as host.localdomain.com.

The other problem is that the local domain must be registered with internic,
and the DNS server hosting the domain name, must be available to the DNS
server that you are querrying, if this is to be availible to the internet.
Now nslookup will almost never work on a domain server that isn't hosting
the domain you want to querry. If you are querrying your own DNS server,
then you need to populate it with the host records (A records) for the
machines you want it to be able to resolve.
If the name resides in the hosts file, then you can resolve it using ping,
but not nslookup. Since the hosts file is not querried by the DNS server
daemon. And since the DNS server daemon doesn't lookup from the host files,
the clients can't querry the dns server to the addresses either.

>
> I'm using suse 6.2. the hosts line that should work is
> 192.168.0.1 yogi
>
> So, how do ping and nslookup differ? What should I be doing
> differently.

Ping is a utility for testing a link betwen to hosts. With all modern ping
utilities you can now specify a host name, and it will resolve it to an IP
address, and attempt to send ICMP echo packets to the destination host. The
method of name lookup is determined by the lookup order. Default lookup
order is defined in the RFCs regarding DNS. It is local cache (in case it's
already been looked up), local hosts file, then dns server query.

nslookup is not use to test the link. ns lookup is used once a link is
working, verify that you DNS server is working proppery, or just to querry
the entries in the name server database. The DNS name server almost never
uses the hosts file, but rather it almost always uses only it's own local
database. Within it's local database, is usually a cache zone allowing for
the lookup/querrying of other DNS server and root servers. The cache will
store the results so that further querries are not required. This is beyone
the scope of your question though. In short, ping test link, and nslookup
is a database server querrying tool to list the contents of zones being
hosted by the DNS server. (a zone is another name for a domain, or sub
domain).


Hope this helps.
Armand Welsh

Armand Welsh

ungelesen,
18.10.1999, 03:00:0018.10.99
an
Microsoft uses HOSTS (and lmhosts) as per the RFC standard. Which means
that linux and windows and unix, and any other os that adhears to the
standard use these files in the same exact way.

David C.

ungelesen,
18.10.1999, 03:00:0018.10.99
an
mbu...@logicalsys.com (Mitchell Burko) writes:
>
> Yes I'm a newbie, but get this. Ping resolves names in /etc/hosts and
> nslookup doesn't. What's up with that?

They're two completely different programs.

Ping attempts to determine if a remote host can be contacted. It does
this by sending ICMP ECHO-REQUEST messages to the host. It waits for a
corresponding ICMP ECHO-REPLY message to come back. Ping will report
when the reply arrives (including the time it took to come back) or it
will timeout and report that it didn't get a reply.

The resolving of names into IP addresses is purely a side-effect, so you
don't need to know the numbers yourself. Just like all other internet
apps (including FTP, TELNET, your web browser, etc.). Like all these
apps, it will try to resolve the name using your local /etc/hosts file,
DNS, NIS, or any other name-resolving scheme your system is configured
for.

nslookup, on the other hand, serves one purpose and one purpose only -
to get data out of DNS-based name servers. As such, it does not
consider data stored in your /etc/hosts file, and it won't use non-DNS
name servers (such as NIS) if they're installed on your network.

-- David

0 neue Nachrichten