Retrieve a domain name based on an IP Address?
Posted
by
Neil Kodner
on Server Fault
See other posts from Server Fault
or by Neil Kodner
Published on 2010-12-29T12:18:15Z
Indexed on
2010/12/29
12:55 UTC
Read the original article
Hit count: 274
I'm reviewing some apache logs, specifically with respect to downloaded files. I'm interested in knowing, if possible, which domain is responsible for the download, given an IP address.
I've given nslookup a try and it seems to (mostly) get the job done but it returns all sorts of extraneous information. Ideally, I pass in an IP and receive a domain back.
Before I write a shell script to parse the output of nslookup to capture the domain, I'd like to know if this is the best way of approaching this problem, or if there is a more tried-and-true method of doing this.
Specifically, I'd like to know if an address resolves to an amazonaws.com domain. I understand that this might be difficult because EC2 machines are dynamically created and destroyed - I'd like to know if the IP addresses for AWS/EC2/EMR machines fit any sort of addressing pattern.
© Server Fault or respective owner