Re: multiple IP addresses in /etc/hosts
On Thu, Feb 08, 2001 at 11:09:01AM -0600, Nick Rogness wrote: > On Thu, 8 Feb 2001, 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? > > AFAIK, not with /etc/hosts. You could do round-robin DNS with > named but it will never be 100% of what you want to do. DNS does > not keep track of which hosts are dead or alive. Well, as far as ping goes you could do this in a very simple way with a script that parses the hosts file and presents each IP as an argument..or am I missing something here ? Cliff To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message
RE: multiple IP addresses in /etc/hosts
> -Original Message- > From: Eric Fiterman [mailto:[EMAIL PROTECTED]] > Sent: Thursday, February 08, 2001 9:42 AM > To: [EMAIL PROTECTED]; [EMAIL PROTECTED] > Subject: multiple IP addresses in /etc/hosts > > > 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? Not exactly sure what your trying to accomplish - just tryuing to verify that the ip addresses are operating the way they should? nmap will probably do what you need, it's a network scanner designed to do things like scan whole subnets. You will find it in ports/security/nmap IIRC, not only is it a great network scanner but it will do other tricks like jump through flaming hoops and TCP thumbprint remote OS's. Gene Dinkey aka Master of my domain aka [EMAIL PROTECTED] To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message
Re: multiple IP addresses in /etc/hosts
On Fri, Feb 09, 2001 at 02:06:31AM +0900, Hajimu UMEMOTO wrote: > > On Thu, 8 Feb 2001 18:51:50 +0200 > > IPv6 aware applications in base system such as telnet, ssh... do > round-robbin so that it can be fall back to use IPv4 if IPv6 > connection is fail. Errr.. oops. I must have been on something. Of course base system telnet does round-robin. Just noticed it yesterday, when I tried telnet'ting to port 25 of a multi-addressed MX by name, and it tried all addresses in turn. So half the original question is answered :) I do not really think such behavior belongs in 'ping' though, especially seeing as ping is usually used as a diagnostics tool. If a host does not respond, this might be temporary, or due to timeouts, or due to some routing/interface problem.. most of the time, I do want to see how it does as time goes by :) G'luck, Peter -- This would easier understand fewer had omitted. To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message
Re: multiple IP addresses in /etc/hosts
> On Thu, 8 Feb 2001 18:51:50 +0200 > Peter Pentchev <[EMAIL PROTECTED]> said: roam> I do not think that any of the applications in the base system have roam> this ability. The only place I've seen it (and am using it in several roam> home-grown apps) is in DJB's ucspi-tcp package (sysutils/ucspi-tcp, or roam> http://cr.yp.to/ucspi-tcp.html), in the 'tcpclient' utility. IPv6 aware applications in base system such as telnet, ssh... do round-robbin so that it can be fall back to use IPv4 if IPv6 connection is fail. -- Hajimu UMEMOTO @ Internet Mutual Aid Society Yokohama, Japan [EMAIL PROTECTED] [EMAIL PROTECTED] ume@{,jp.}FreeBSD.org http://www.imasy.org/~ume/ To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message
Re: multiple IP addresses in /etc/hosts
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
Re: multiple IP addresses in /etc/hosts
On Thu, 8 Feb 2001, 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? AFAIK, not with /etc/hosts. You could do round-robin DNS with named but it will never be 100% of what you want to do. DNS does not keep track of which hosts are dead or alive. Nick Rogness <[EMAIL PROTECTED]> - Keep on routing in a Free World... "FreeBSD: The Power to Serve!" To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message