[vox-tech] Getting next-closest hostname for an IP address

Bill Kendrick nbs at sonic.net
Sun Sep 26 19:12:44 PDT 2004


On Sun, Sep 26, 2004 at 06:55:09PM -0700, ME wrote:
> With shell scripting, it should be possible:
> $ export BEFORE=`traceroute passwall.com 2>&1 | tail --lines=2 | head
> --lines=1 | cut -d' ' -f2-3 | tr -d ' '`
> $ echo $BEFORE

Worked like a charm!

(Well, actually, 'traceroute' here on Sonic.net's shell system seems to be
set up to NOT do hostname lookups, but a quick "host $BEFORE" gave me what
I wanted.  And the server I'll actually be doing this on seems to have
'traceroute' set up to do lookups automatically, so "$BEFORE" contained the
magic hostname I was looking for!)

Sweet!

-bill!


More information about the vox-tech mailing list