home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / unix / programm / 5712 < prev    next >
Encoding:
Internet Message Format  |  1992-12-16  |  1.6 KB

  1. Xref: sparky comp.unix.programmer:5712 comp.sources.wanted:5396 comp.lang.perl:7452
  2. Newsgroups: comp.unix.programmer,comp.sources.wanted,comp.lang.perl
  3. Path: sparky!uunet!psinntp!hyphenw!dwight
  4. From: dwight@hyphen.com (Dwight Ernest)
  5. Subject: Re: Get hostname from IP address
  6. Message-ID: <1992Dec16.015357.10437@hyphen.com>
  7. Organization: Hyphen, Inc., Wilmington, MA 01887 USA / +1 508 988-0880
  8. 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>
  9. Date: Wed, 16 Dec 1992 01:53:57 GMT
  10. Lines: 24
  11.  
  12. tim@deakin.OZ.AU (Tim Cook) writes:
  13.  
  14. >dejesus@archimedes.nwc.navy.mil (Francisco X DeJesus) writes:
  15. >>
  16. >> I'd like to find a utility I can call from the command-line with an
  17. >> internet IP address as an argument, and have it return to me the full
  18. >> hostname related to it. I've looked into the function gethostbyaddr()
  19. >> but haven't been able to work. I also remember reading about a name-
  20. >> resolver funtion nres_gethostbyaddr() (sp?), but can't find any
  21. >> references to it on my system. I'm running SunOS 4.1.2 on a Sparc.
  22.  
  23. >There Is Always A Simple Perl Script That Will Do It (tm).
  24.  
  25. >The enclosed Perl script will convert a DNS hostname to an IP address
  26. >or vice-versa.
  27.  
  28. 50+ lines of perl followed.  Simple?  (grin)  Took me about 15 mins to
  29. hack up both the C programs posted earlier.  How long did it take you
  30. to cook the perl?  Just curious.
  31.  
  32. -- 
  33. --Dwight A. Ernest   R&D Manager (USA)     I speak only for myself.
  34.   Hyphen, Inc./181 Ballardvale St./Wilmington, MA 01887/+1 508 988 0880 x125
  35.   dwight@hyphen.com
  36.