On Thu, Feb 08, 2001 at 11:41:59AM -0500, Eric Fiterman wrote:
> Hi:
> 
>   Is it possible to have an application like ping or telnet iterate
> through IP addresses for a given hostname, if a previous attempt fails?
> 
>   For example:
> 
>   in /etc/hosts:
> ---------------
>   0.0.0.1 testhost
>   0.0.0.2 testhost
>   0.0.0.3 testhost
> ---------------
> 
> If I attempt to 'ping testhost', and the first entry (0.0.0.1) fails, is
> there anything to configure which would allow an automatic attempt to
> ping 0.0.0.2? Is this possible?

I do not think that any of the applications in the base system have
this ability.  The only place I've seen it (and am using it in several
home-grown apps) is in DJB's ucspi-tcp package (sysutils/ucspi-tcp, or
http://cr.yp.to/ucspi-tcp.html), in the 'tcpclient' utility.

If you specify a destination hostname that resolves to several IP
addresses, tcpclient shall try each one of them in turn until one is
successful.  You can specify the timeout and the retry count.

I guess one could write a telnet client that runs under tcpclient,
or adapt the one in the base system to read from fd 6 and write to
fd 7 (or the other way round, I forget).  Come to think of it,
adapting the base system telnet client to read/write to fd's specified
as cmdline options might be a nice idea.. I just might look into it.

G'luck,
Peter

-- 
This sentence no verb.


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to