Date: Thu, 8 Feb 2001 18:51:50 +0200 From: Peter Pentchev <roam@orbitel.bg> To: Eric Fiterman <fiterman@torrentnet.com> Cc: freebsd-questions@freebsd.org, freebsd-hackers@freebsd.org Subject: Re: multiple IP addresses in /etc/hosts Message-ID: <20010208185150.B35971@ringworld.oblivion.bg> In-Reply-To: <3A82CC57.3D1F5AB4@torrentnet.com>; from fiterman@torrentnet.com on Thu, Feb 08, 2001 at 11:41:59AM -0500 References: <3A82CC57.3D1F5AB4@torrentnet.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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 majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010208185150.B35971>