This article is from a FAQ concerning SCO operating
systems. While some of the information may be applicable to any OS,
or any Unix or Linux OS, it may be specific to SCO Xenix, Open
Desktop or Openserver.
There is lots of Linux, Mac OS X and general Unix info elsewhere on
this site: Search this site is the best
way to find anything.
If you're finding that ping times are measured in seconds, even for hosts which you know should be responding faster, it's usually a DNS problem. Even if you supply ping with an IP address, it still does DNS lookups so that when it get a packet back, it can display both the IP address and the host name.
Test to see if it's a DNS problem by using ping -n; the -n flag turns off DNS lookups. If ping -n works quickly but ping takes forever, you have a DNS problem. Check the entries in /etc/resolv.conf and make sure that they do, in fact, point to functional and reachable DNS servers. It's also a good idea, when troubleshooting DNS problems, to ping -n each of the DNS servers listed in /etc/resolv.conf to ensure that the machines are actually alive. As well, try using them to do DNS lookups to make sure not only that the machines are running but that they have usable DNS servers on them (e.g. if you list aaa.bbb.ccc.ddd as one of your servers, try nslookup www.foo.com aaa.bbb.ccc.ddd).
Finally: /etc/resolv.conf needs to be readable by everyone. Do "chmod 644 /etc/resolv.conf" if it is not.
A sample resolv.conf:
domain whatever.com
nameserver 216.70.169.66
nameserver 216.70.169.67
hostresorder local bind
DON'T USE THESE NAMESERVERS! Use nameservers close to your network- usually your ISP's nameservers.
You replace "whatever.com" with your local domain name. If you have no idea what that means, look in /etc/hosts- you probably set SOMETHING when you installed the machine. This part isn't really important unless you have an internal network of machines- what it does is tell the resolver which domain names YOU are responsible for. Just don't set it to a real domain like "caldera.com"- that would mess you up.
Replace the xxx.xxx.xxx.xxx in the "nameserver" lines with the addresses your ISP gave you. Note that these HAVE to be numeric addresses, not host.domain names. You can have multiple nameserver lines.
That's it- you don't have to reboot- it will work instantly.
Bela Lubkin discussed this in a recent post:
Newsgroups: comp.unix.sco.misc
Path: nntp.TheWorld.com!world!newsfeed.mathworks.com!enigma.xenitec.on.ca!news.xenitec.on.ca!news
From: Bela Lubkin
Subject: Re: DNS or router trouble? [possible FAQ material?]
> Sorry for another question like this. But my 'ping' is slow! Ya Ya I
> know, not this again. But I've been reading for days on deja and I
> haven't found a solution yet. Thanks for your patience.
>
> We have our OpenServer 5.06a box connected to a large network at the
> customer site. They are using a Windows 2000 box as the DNS server and
> DHCP server.
>
> A series of machines at 192.168.1.xxx are assigned a fixed address which
> includes our SCO server.
> All other machines are assigned addresses by the DHCP server onto an
> network of 10.14.100.xxx.
>
> If I ping a machine using hostname on 192.168.1.xxx it works great.
> If I ping a machine using hostname on 10.14.100.xxx it takes forever!
>
> Here is an exampe output of 'ping hostname'
> The response takes several seconds before it is displayed.
>
> ============================================================================================
>
> root@scobox /etc# ping hostname
> PING hostname.customerdomain.com (10.14.100.17): 56 data bytes
> 64 bytes from 10.14.100.17 (10.14.100.17): icmp_seq=0 ttl=127 time=0.754 ms
> 64 bytes from 10.14.100.17 (10.14.100.17): icmp_seq=1 ttl=127 time=14869.597 ms
> 64 bytes from 10.14.100.17 (10.14.100.17): icmp_seq=2 ttl=127 time=13869.699 ms
...
> 64 bytes from 10.14.100.17 (10.14.100.17): icmp_seq=15 ttl=127 time=1107.100 ms
> 64 bytes from 10.14.100.17 (10.14.100.17): icmp_seq=16 ttl=127 time=107.208 ms
>
> --- hostname.customerdomain.com ping statistics ---
> 17 packets transmitted, 17 packets received, 0% packet loss
> round-trip min/avg/max = 0.754/7037.584/14869.597 ms
>
> =========================================================================================
>
> If I use 'ping -n hostname' it is fast as expected.
>
> Every thing I have read from the group indicates this is a DNS problem.
> But if I try 'nslookup hostname' it responds with an address
> immediately. I was under the impression that this would be a good test
> of the DNS.
That's a reasonable smoke-test of forward DNS resolution. Your problem
is with reverse DNS resolution. `ping` is trying to translate the
numeric IP address, 10.14.100.17, to a name. The DNS server is
responding slowly to this request.

ping works by having two separate logical threads of execution. One
sends out periodic packets; the other receives the responses and prints
them out. What's happening here is that the reader thread is being
blocked for a long time by DNS, even though the writer is still sending
a new packet every second. Responses #1 through 15 were probably
received in perfectly normal amounts of time, but they didn't get _read_
until the delayed DNS response to packet #1 was finished.
Notice how the times step down by about 1 second per packet: this is
because, when the DNS response was finally received, the rest of the
queued responses were absorbed quickly.
It's a bit odd that your DNS server happily responded immediately to the
_first_ query about 10.14.100.17 (packet #0), and slowly to the second.
But that's up to the DNS server.
If you had given exactly the same symptoms, but said that the behavior
was the _same_ with `ping -n`, I would give a radically different
diagnosis. In that case I would say that an intermediate router between
you and 10.14.100.17 was experiencing intermittent line drops. Suppose
there are 7 hops between you and 10.14.100.17, and that the connection
between hops 3 & 4 is a dialup modem. If the modem hung up, machine #3
would redial machine #4, which would take several seconds. Depending on
its IP-over-modem implementation, it could choose to either drop packets
received during the down time, or queue them. If you saw the results
you showed, it would tell you that machine #3 was queuing the packets
while redialing. Then it send them all on to machine #4, so on down the
line to 10.14.100.17, and back to you; the responses all arrived in a
burst at about the same time.
This behavior would happen whether or not you were having ping do
reverse-DNS lookups, so it isn't what's going on in your case. The
scenario with the downed intermediate route would probably also have one
other difference: the burst of responses when the line came back up
would probably be somewhat out of sequence. That can't happen with the
DNS delay scenario since all of the received packets are already sitting
on your machine, waiting to be read by ping, in an ordered queue.
>Bela<
Enter your email address for automatic notification of new posts here
(be sure to whitelist 'feedburner.com' if you use spam filtering)
| Views for this page | ||||
|---|---|---|---|---|
| Today | This Week | This Month | This Year | Overall |
| 5 | 31 | 196 | 3,805 | 4,301 |
/SCOFAQ/FAQ_slow_ping.html copyright 1997-2003 (various) All Rights Reserved
Have you tried Searching this site?
Unix/Linux/Mac OS X support by phone, email or on-site: Support Rates
This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more. We appreciate comments and article submissions.

Add your comments