🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.sys.sgi.admin
7 messages
7 total messages Started by Fred R. Beck Mon, 14 Dec 1992 17:24
system names from IP
#5
Author: Fred R. Beck
Date: Mon, 14 Dec 1992 17:24
17 lines
1151 bytes
Howdy!

Has anyone out there ever tried to resolve a system name
from an IP number?  I've been poking around and the closest
utility I have found if rarp; however, it resolves IP from
hardware ethernet address.

Any help would be appreciated!

-fred

****************************************************************************
  Fred R. Beck	:-)                 Martin Marietta Astronautics Group
  beck@enterprise.den.mmc.com        P.O. Box 179
  (303) 971-1584                     Attn. Fred Beck, M.S. L5420
  FAX:  (303) 971-2563               Denver, Colorado  80201
****************************************************************************
Re: system names from IP
#8
Author: John "Jack" Repenning
Date: Mon, 14 Dec 1992 17:58
17 lines
1062 bytes
In article <1992Dec14.172453.26933@den.mmc.com> beck@enterprise.den.mmc.com (Fred R. Beck) writes:

   Has anyone out there ever tried to resolve a system name
   from an IP number?

It turns out to be even easier than one other responder suggests.
I've never seen documentation that admits this (so it's probably
totally unofficial), but every version of nslookup I've ever tried
will accept:

	nslookup <<EOF
	set q=ptr
	$1
	EOF

That is, you don't need the shell-game to reverse the address and add
"in-addr.arpa".
Re: system names from IP
#7
Author: Sam Fulcomer
Date: Mon, 14 Dec 1992 19:27
26 lines
1151 bytes
In article <1992Dec14.172453.26933@den.mmc.com>, beck@enterprise.den.mmc.com (Fred R. Beck) writes:
|> Howdy!
|> 
|> Has anyone out there ever tried to resolve a system name
|> from an IP number?  I've been poking around and the closest

I just use a stupid shell (csh) script which I've never bothered to make more
elegant (stdin if argc = 1, argc >2, etc...):

#!/bin/csh

set revaddr=`echo $1 | awk -F. '{printf("%s.%s.%s.%s\n",$4,$3,$2,$1)}' `

nslookup <<%%

set query=ptr
set domain=in-addr.arpa

$revaddr

%%
 

-- 
_/**/Sam_Fulcomer	sgf@cfm.brown.edu	What, me panic: uba crazy
Brown University  Center for Fluid Mechanics, Turbulence  and Computation
Re: system names from IP
#13
Author: Bernhard Hofmann
Date: Tue, 15 Dec 1992 15:35
12 lines
784 bytes
beck@enterprise.den.mmc.com (Fred R. Beck) writes:

>Howdy!

>Has anyone out there ever tried to resolve a system name
>from an IP number?

Have a look at the man page of gethostbyaddr. A simple C code should
do the job.

Have fun,
Bernhard
Zmodem and/or Xmodem for Irix4.0.1
#16
Author: MSKKSMSMKSKM
Date: Tue, 15 Dec 1992 20:57
12 lines
1089 bytes
I was wondering if any of you have gotten zmode (sz,rz) compiled
for IRIX4.0.1?  I tried compiling it and it complained about
ioctl missing.  If any of you have sz or rz compiled I would
appreciate sharing sources and binaries with me.  

Thank You
-msk
__
_________________________    __________________________________________ 
Mark S Kassem            \+++\ Another month ends, all targets met, all 
CIS Sys & Net Manager     \   \    systems working, all users satisfied
msk@doomsday.micro.umn.edu \+++\        All Pigs Fed and Ready to fly!!
Re: system names from IP
#21
Author: Dirk Wisse
Date: Wed, 16 Dec 1992 12:35
85 lines
2154 bytes
hofmann@nova.tat.physik.uni-tuebingen.de (Bernhard Hofmann) writes:

>beck@enterprise.den.mmc.com (Fred R. Beck) writes:

>>Howdy!

>>Has anyone out there ever tried to resolve a system name
>>from an IP number?

>Have a look at the man page of gethostbyaddr. A simple C code should
>do the job.

Like this:

------- cut here ----------


#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/time.h>
#include <sys/ioctl.h>
#include <sys/errno.h>
#include <netdb.h>


void main (int argc, char **argv)
{
		
    struct hostent
        *ent;
    long unsigned
        adr;
    char *p;

    if (argc!=2)
    {
         fprintf(stderr,"\nusage: %s <IP name or address>\n",argv[0]);
         exit(1);
    }

    ent=gethostbyname (argv[1]);
    if (ent==0)
    {
    	adr=inet_addr(argv[1]);            
    	ent=gethostbyaddr ((char *)&adr,4,2);
    }

    if (ent==0)
    {
	fprintf(stderr,"\nno such name or address\n");
  	exit(1);
    }
    printf("Official name	: %s\n",ent->h_name);
    while ((p= *(ent->h_aliases)) != NULL)
    {
	printf ("Alias		: %s\n", p);
	ent->h_aliases++;
    }
    while ((p= *(ent->h_addr_list)) != NULL)
    {
	printf("Address		: %s ( 0x%08lx )\n", inet_ntoa((struct in_addr *)p), *(unsigned long *)p);
        ent->h_addr_list++;
    }
}


------- cut here ----------


You specify an IP hostname or an IP address on the commandline. You get
all the information there is in the entry form the DNS.


>Have fun,
>Bernhard


The same from me,
Dirk
--
--
Dirk Wisse

Internet: Dirk.Wisse@dnpap.et.tudelft.nl
Re: system names from IP
#20
Author: Daniel Rich
Date: Wed, 16 Dec 1992 17:10
20 lines
1295 bytes
In article <hofmann.724433734@nova> hofmann@nova.tat.physik.uni-tuebingen.de (Bernhard Hofmann) writes:
>beck@enterprise.den.mmc.com (Fred R. Beck) writes:
>>Has anyone out there ever tried to resolve a system name
>>from an IP number?

>Have a look at the man page of gethostbyaddr. A simple C code should
>do the job.

Or, since this is an SGI group, you can type:
	nslookup -type=PTR ipaddress

For example, for uunet, type:
	nslookup -type=PTR 137.39.1.2


-- 
Dan Rich                    | drich@lerc.nasa.gov   |  (216) 433-4000
Sr. Systems Engineer        | "Danger, you haven't seen the last of me!"
RMS Technologies, Inc.      |    "No, but the first of you turns my stomach!"
NASA Lewis Research Center  | -- The Firesign Theatre's Nick Danger
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads