I'm trying to programmaticaly determine the company* associated with a given IP address.
My first guess was this :
string hostname = Dns.GetHostEntry(IPAddress.Parse(ip)).HostName;
but this won't work if the reverse DNS isn't set correctly, which seems to happen 90% of the time.
However some websites are still able to successfully determine the company associated with a specific IP even if the reverse dns fails. For example, on this site, the ISP Provider field sometimes contains valuable information (ie the name of the company) even if the hostname isn't set.
What's the easiest way to achieve the same thing using .net ?
Notes :
Edit regarding the use of whois : Sometimes, there's no whois information associated with an IP
You can install the whois command line tool for windows from microsoft
edit: then what information are you looking for ?
>whois bbc.co.uk
Domain name:
bbc.co.uk
Registrant:
British Broadcasting Corporation
Registrant type:
UK Limited Company, (Company number: 000057)
Registrant's address:
Research & Development
Kingswood Warren
Tadworth
Surrey
KT20 6NP
United Kingdom
Registrar:
British Broadcasting Corporation [Tag = BBC]