Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am running Kubuntu 6.04 and I've been using ping without setting any switches. When the host is down then it returns "unknown host". According to the man page the -W (timeout) option can be set, but there is no mention of what the default setting is. Can someone please enlighten me?
For iputils 2007-11-27 it seems to be 10 seconds at least it is the value it is initialized to. I am not sure if it scales that as packets are successfully received or not.
The man page give:
-W timeout
Time to wait for a response, in seconds. The option affects only timeout in absence of any responses, otherwise ping waits for two RTTs.
You can get the source code yourself from iputils if you wanted to dig into it.
It seems that if I ping my ISP then it goes on forever if I don't stop it. However if there is no response then it goes for a minute or more. That is the time I was interested in right now.
I just pinged a non existant url and it quit after about 5 seconds. Trying it the second time it quit right away. So, yes, there is some scaling factor relating to things beyond my emediate control.
Perhaps I'm not asking the right question since the DNS servers are obviously involved in the time that I'm looking for. I didn't realize that the situation was more complicated. I'll try an old fashioned stop watch next time it happens.
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660
Rep:
Quote:
Originally Posted by Ole Juul
I just pinged a non existant[sic] url and it quit after about 5 seconds. Trying it the second time it quit right away. So, yes, there is some scaling factor relating to things beyond my emediate[sic] control.
First off, you cannot ping Uniform Resource Locators as they contain extra meta information that is not contained in DNS. What you meant to say was "hostname".
Second, if a hostname cannot be resolved to an IP address, there's no IP to send a packet to, hence one cannot be sent. This is entirely different than trying to ping an IP address that cannot be reached by ICMP messages.
Most DNS caches these days have "negative caching", which is to say they not only remember recent hostname -> IP mappings that they've looked up, but they also remember when they couldn't find an IP for a particular hostname.
Thank you for the clarification and information chort. (And the spelling/typo corrections too.) That all makes sense.
I still don't know what the default timeout is for my particular Linux installation's ping executable. Generally I use the one that comes with WATTCP (presumably by Engelke) and it only does one ping by default and spaces multiple pings one second apart - limited perhaps, but friendly. Linux is less accessible and sparsely documented so I have to ask other people about many things.
Being an amateur (and beginner), the incomplete man page for ping is almost useless to me. It is both generic and unfinished. Can someone point me to some practical documentaion for this command as it is compiled into Ubuntu?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.