When I try to ping a hostname of a computer that is down, I get en error that it cannot resolve the hostname.

$ alice:~ me$ ping bob
ping: cannot resolve bob: Unknown host

Is there a way I can make ping more persistent? I want it to keep trying so I can see when bob comes back online.

link|improve this question

68% accept rate
1  
Do you expect the name to resolve when the host comes up? – Ignacio Vazquez-Abrams Dec 15 '10 at 3:40
@Ignacio: Yes, that's what I expect. And it does. – Svish Dec 15 '10 at 18:35
feedback

1 Answer

up vote 1 down vote accepted

a)

while true; do
    ping bob
done

or b) Configure a name resolution method that doesn't rely on the target host being up. /etc/hosts for the lazy.

link|improve this answer
Nice and simple, I like it. – Svish Dec 15 '10 at 18:36
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.