Skip to content
This repository has been archived by the owner on Dec 2, 2017. It is now read-only.

j-mie/Shapis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SharpIs Build status

WHOIS lookups for C#

Target How do I use it

Just reference the Shapis.dll and add something like the following:

WhoisRecord rec = WhoisLookup.Lookup("jamiehankins.co.uk");

You can then access the returned information as an ArrayList which can be looped through like the following

foreach (var v in rec.Text) { Console.WriteLine(v); }

You can see which WHOIS server was queried by looking at the Server string of the record

Console.WriteLine(rec.Server);

How does this work?

This does a DNS query to a subdomain of whois-servers.net. The subdomain is based off the TLD of the domain being queried. Say I wanted to query google.com, The library gets the TLD and does a DNS lookup of com.whois-servers.net which returns

Name: whois.verisign-grs.com

We can then connect to this using a TCP Client and lookup the domains information which is returned as a WhoisRecord