home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.unix.programmer:5712 comp.sources.wanted:5396 comp.lang.perl:7452
- Newsgroups: comp.unix.programmer,comp.sources.wanted,comp.lang.perl
- Path: sparky!uunet!psinntp!hyphenw!dwight
- From: dwight@hyphen.com (Dwight Ernest)
- Subject: Re: Get hostname from IP address
- Message-ID: <1992Dec16.015357.10437@hyphen.com>
- Organization: Hyphen, Inc., Wilmington, MA 01887 USA / +1 508 988-0880
- References: <Bz2FFM.D4z@avalon.nwc.navy.mil> <1992Dec11.152438.18365@fwi.uva.nl> <1992Dec13.122835.28103@hyphen.com> <1992Dec13.180845.28960@hyphen.com> <1gj9afINN47k@mimas.cc.deakin.OZ.AU>
- Date: Wed, 16 Dec 1992 01:53:57 GMT
- Lines: 24
-
- tim@deakin.OZ.AU (Tim Cook) writes:
-
- >dejesus@archimedes.nwc.navy.mil (Francisco X DeJesus) writes:
- >>
- >> I'd like to find a utility I can call from the command-line with an
- >> internet IP address as an argument, and have it return to me the full
- >> hostname related to it. I've looked into the function gethostbyaddr()
- >> but haven't been able to work. I also remember reading about a name-
- >> resolver funtion nres_gethostbyaddr() (sp?), but can't find any
- >> references to it on my system. I'm running SunOS 4.1.2 on a Sparc.
-
- >There Is Always A Simple Perl Script That Will Do It (tm).
-
- >The enclosed Perl script will convert a DNS hostname to an IP address
- >or vice-versa.
-
- 50+ lines of perl followed. Simple? (grin) Took me about 15 mins to
- hack up both the C programs posted earlier. How long did it take you
- to cook the perl? Just curious.
-
- --
- --Dwight A. Ernest R&D Manager (USA) I speak only for myself.
- Hyphen, Inc./181 Ballardvale St./Wilmington, MA 01887/+1 508 988 0880 x125
- dwight@hyphen.com
-