Date: Tue, 16 Oct 2001 20:51:56 -0000
Reply-To: David Wall <darkon@ONE.NET>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: David Wall <darkon@ONE.NET>
Organization: Posted via Supernews, http://www.supernews.com
Subject: Re: Resolving an IP-address
Brad.Goldman@AUTOTRADER.COM wrote on 16 Oct 2001:
>> Does anyone know how I can resolve an IP-address from SAS?
>> That is, make
>> 188.8.131.52 look like www.somedomain.com?
> There is no easy way. I've been working on and off for months on a
> project to do just this. And I know of at least two other lurkers who
> want to steal -- I mean, get inspired by! -- my code if I ever finish.
> Here is the basic algorithm.
> *get a dataset of the tcpips to lookup
> *Loop through this dataset, dymanically build a shell script (I'm in
> unix) that has a bunch of whois commands.
> *x "shellscript"
> *when results are in, parse the results text file that the shellscript
That sounds awfully complicated. Since all you want to do is turn IPs
into DNS, write one simple (non-SAS) program that reads an input (text)
file with IP addresses, one per line, resolves the DNS name, and creates
an output file with the IP address and DNS name on the same line. Then
have SAS get the IPs, write them to a text file, use x to execute the
little non-SAS program, then have SAS read in the IP and DNS from the
output file. I'd write the non-SAS part in Perl, since it has tools that
make this kind of thing easy, but you could use C or whatever.