A little over a week ago I posted to ask about some way (from the command
line) to get a hostname from an IP address. Here's the results:
A lot of people suggested using nslookup for this. The way to find out
the hostname associated with IP address A.B.C.D with this method is:
nslookup
...this works, though it can be a bit tedious. Someone suggested the followingQuote:> set type=ptr
> D.C.B.A.in-addr.arpa
alias to make it simpler:
alias ptr '( echo set q=PTR ; echo \!$:e.\!$:r:e.\!$:r:r:e.\!$:r:r:r.in-addr.arpa ) | nslookup'
...then, typing "ptr A.B.C.D" from your prompt gives you back the answer
(assuming you had nslookup running to begin with).
I also got a few pointers to a couple of programs out there that may be
handy to have installed: "dig", "host", and "hname" (consult your nearest
archie server). Finally, I received source code in C and Perl for programs
that do the same thing (drop me a line if you want 'em).
Thanks to everyone who replied...
--
---------------------------------------------------------------------------
* disclaimer: Opinions expressed here are mine. Typos and errors are yours *
"Duck Season!" "Rabbit Season!" "...rabbit season." "It's Duck Season! SHOOT!"