A .NET WHOIS library written in C#
C#
Latest commit 502131e Nov 2, 2014 @flipbit Build and Sample Updates
- Removed old build binaries
- Added more sample WHOIS records
- Updated Tokenizer library to 1.0.1

README.md

.NET WHOIS Lookup

.NET WHOIS is a drop-in library that enables you to query WHOIS information for domain registrations in .NET projects. The library doesn't have any dependencies and returns an object representing the WHOIS data.

Installation

You can install the library via the NuGet GUI or by entering the following command into the Package Manager Console:

Install-Package Whois

The source code is available on Github and can be downloaded and compiled.

Usage

To use the library, reference it in your project and then use the following code:

using namespace Whois;

var whois = new WhoisLookup().Lookup("github.com");

Console.WriteLine(whois.ToString());

How The Library Works

The library works by querying CenterGate’s whois-servers.net in order to find the correct WHOIS server for the TLD. The TLD WHOIS server is then queried in order to get the WHOIS information for the domain. Queries to WHOIS servers are made using TCP.

Whois Query Flow Diagram

Extending

As WHOIS data is returned in free text format, custom Visitor classes need to be written to extract information and return it in a structured format. Currently only the registration date is returned for a number of registrars, however this can easily be extended by writing new visitors.

Further Reading

Further deatils about how the library works can be found on this blog post.