How to lookup domain WHOIS using C# in .NET Framework

Today’s tutorial will cover a quick and easy method to get WHOIS for a web domain, providing you with useful registration and ownership information. Let’s get started.

First, we will run the following command in the console of Package Manager to install the API client that we need to use.

Install-Package Cloudmersive.APIClient.NET.Validate -Version 1.2.7

Second, call the function DomainPost with the desired domain.

using System;
using System.Diagnostics;
using Cloudmersive.APIClient.NET.Validate.Api;
using Cloudmersive.APIClient.NET.Validate.Client;
using Cloudmersive.APIClient.NET.Validate.Model;
namespace Example
public class DomainPostExample
public void main()
// Configure API key authorization: Apikey
Configuration.Default.AddApiKey("Apikey", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Configuration.Default.AddApiKeyPrefix("Apikey", "Bearer");
var apiInstance = new DomainApi();
var domain = domain_example; // string | Domain name to check, for example \"\". The input is a string so be sure to enclose it in double-quotes.
// Get WHOIS information for a domain
WhoisResponse result = apiInstance.DomainPost(domain);
catch (Exception e)
Debug.Print("Exception when calling DomainApi.DomainPost: " + e.Message );

That’s it! Super easy, right? Here is an example return for

"ValidDomain": true,
"WhoisServer": "",
"RawTextRecord": "Domain Name:\r\nRegistry Domain ID: 2138514_DOMAIN_COM-VRSN\r\nRegistrar WHOIS Server:\r\nRegistrar URL:\r\nUpdated Date: 2019-09-09T08:39:04-0700\r\nCreation Date: 1997-09-15T00:00:00-0700\r\nRegistrar Registration Expiration Date: 2028-09-13T00:00:00-0700\r\nRegistrar: MarkMonitor, Inc.\r\nRegistrar IANA ID: 292\r\nRegistrar Abuse Contact Email:\r\nRegistrar Abuse Contact Phone: +1.2083895740\r\nDomain Status: clientUpdateProhibited (\r\nDomain Status: clientTransferProhibited (\r\nDomain Status: clientDeleteProhibited (\r\nDomain Status: serverUpdateProhibited (\r\nDomain Status: serverTransferProhibited (\r\nDomain Status: serverDeleteProhibited (\r\nRegistrant Organization: Google LLC\r\nRegistrant State/Province: CA\r\nRegistrant Country: US\r\nAdmin Organization: Google LLC\r\nAdmin State/Province: CA\r\nAdmin Country: US\r\nTech Organization: Google LLC\r\nTech State/Province: CA\r\nTech Country: US\r\nName Server:\r\nName Server:\r\nName Server:\r\nName Server:\r\nDNSSEC: unsigned\r\nURL of the ICANN WHOIS Data Problem Reporting System:\r\n>>> Last update of WHOIS database: 2019-09-19T19:01:25-0700 <<<\r\n\r\nFor more information on WHOIS status codes, please visit:\r\n\r\n\r\nIf you wish to contact this domain’s Registrant, Administrative, or Technical\r\ncontact, and such email address is not visible above, you may do so via our web\r\nform, pursuant to ICANN’s Temporary Specification. To verify that you are not a\r\nrobot, please enter your email address to receive a link to a page that\r\nfacilitates email communication with the relevant contact(s).\r\n\r\nWeb-based WHOIS:\r\n\r\n\r\nIf you have a legitimate interest in viewing the non-public WHOIS details, send\r\nyour request and the reasons for your request to\r\nand specify the domain name in the subject line. We will review that request and\r\nmay ask for supporting documentation and explanation.\r\n\r\nThe data in MarkMonitor’s WHOIS database is provided for information purposes,\r\nand to assist persons in obtaining information about or related to a domain\r\nname’s registration record. While MarkMonitor believes the data to be accurate,\r\nthe data is provided \"as is\" with no guarantee or warranties regarding its\r\naccuracy.\r\n\r\nBy submitting a WHOIS query, you agree that you will use this data only for\r\nlawful purposes and that, under no circumstances will you use this data to:\r\n (1) allow, enable, or otherwise support the transmission by email, telephone,\r\nor facsimile of mass, unsolicited, commercial advertising, or spam; or\r\n (2) enable high volume, automated, or electronic processes that send queries,\r\ndata, or email to MarkMonitor (or its systems) or the domain name contacts (or\r\nits systems).\r\n\r\ reserves the right to modify these terms at any time.\r\n\r\nBy submitting this query, you agree to abide by this policy.\r\n\r\nMarkMonitor is the Global Leader in Online Brand Protection.\r\n\r\nMarkMonitor Domain Management(TM)\r\nMarkMonitor Brand Protection(TM)\r\nMarkMonitor AntiCounterfeiting(TM)\r\nMarkMonitor AntiPiracy(TM)\r\nMarkMonitor AntiFraud(TM)\r\nProfessional and Managed Services\r\n\r\nVisit MarkMonitor at\r\nContact us at +1.8007459229\r\nIn Europe, at +44.02032062220\r\n--\r\n",
"CreatedDt": null
Image for post
Image for post

Written by

There’s an API for that. Cloudmersive is a leader in Highly Scalable Cloud APIs.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store