From owner-freebsd-questions Thu Feb 8 8:53:56 2001 Delivered-To: freebsd-questions@freebsd.org Received: from ringworld.nanolink.com (pool147-tch-1.Sofia.0rbitel.net [212.95.170.147]) by hub.freebsd.org (Postfix) with SMTP id 9956937B4EC for ; Thu, 8 Feb 2001 08:53:32 -0800 (PST) Received: (qmail 36070 invoked by uid 1000); 8 Feb 2001 16:51:50 -0000 Date: Thu, 8 Feb 2001 18:51:50 +0200 From: Peter Pentchev To: Eric Fiterman Cc: freebsd-questions@freebsd.org, freebsd-hackers@freebsd.org Subject: Re: multiple IP addresses in /etc/hosts Message-ID: <20010208185150.B35971@ringworld.oblivion.bg> Mail-Followup-To: Eric Fiterman , freebsd-questions@freebsd.org, freebsd-hackers@freebsd.org References: <3A82CC57.3D1F5AB4@torrentnet.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <3A82CC57.3D1F5AB4@torrentnet.com>; from fiterman@torrentnet.com on Thu, Feb 08, 2001 at 11:41:59AM -0500 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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-questions" in the body of the message