title: How can I determine which company an IP address belongs to?
body: <p>I'm trying to programmaticaly determine the company* associated with a given IP address.</p>
  
  <p>My first guess was this :</p>
  
  <pre><code>  string hostname = Dns.GetHostEntry(IPAddress.Parse(ip)).HostName;
  </code></pre>
  
  <p>but this won't work if the reverse DNS isn't set correctly, which seems to happen 90% of the time.</p>
  
  <p>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 <a href="http://www.ipaddresslocation.org" rel="noreferrer">this site</a>, the ISP Provider field sometimes contains valuable information (ie the name of the company) even if the hostname isn't set.</p>
  
  <p>What's the easiest way to achieve the same thing using .net ?</p>
  
  <hr>
  
  <p>Notes : </p>
  
  <ul>
  <li>I don't need a canonical name. ie MS or Microsoft are both ok.</li>
  <li>I'm targeting big companies, which are likely to "own" their IP address ranges.</li>
  <li>I'm running on Windows, so unix's whois tools are not installed by default.</li>
  </ul>
  
  <hr>
  
  <p>Edit regarding the use of whois : Sometimes, <a href="http://www.db.ripe.net/whois?form_type=advanced&amp;full_query_string=&amp;searchtext=121.243.106.222&amp;do_search=Search&amp;inverse_attributes=None&amp;ip_search_lvl=Default(nearest+match)&amp;alt_database=RIPE&amp;object_type=All" rel="noreferrer">there's no whois information associated with an IP</a></p>