Detail information about Whois server reply
Background
Today I want to test how WHOIS query and response protocol works, I read some information on Wiki and start writing code. After 5 minutes I have complete and working code, but I have some questions what I want to share with you.
Code
Here is a simple code that makes requests to the given whois.iana.org url and get replies from it. For example here I make a request for vitobrothersoft.com and get reply. Now the main question is not how this all works it is understandable for me. While Testing this part of code I change request domains whois.iana.org, com.whois-servers.net, whois.verisign-grs.com and in some ways the replies were same in some ways no. You can see example of reply bellow.
#include "stdafx.h"
using namespace System;
#define PORT 43
int main(array<System::String ^> ^args)
{
System::Net::Sockets::TcpClient^ client = gcnew System::Net::Sockets::TcpClient("whois.iana.org", PORT);
if( client != nullptr ) {
System::String^ formatedDomain = "vitobrothersoft.com" + "\r\n";
System::Text::Encoding^ ascii = System::Text::Encoding::ASCII;
array<System::Byte>^ byteUrl = ascii->GetBytes(formatedDomain);
System::IO::Stream^ stream = client->GetStream();
// Write formatted URL to stream.
stream->Write( byteUrl, 0, formatedDomain->Length );
System::IO::StreamReader^ streamReader = gcnew System::IO::StreamReader( stream, System::Text::Encoding::ASCII );
Console::Write( streamReader->ReadToEnd( ) );
}
}
Reply Example
[Querying com.whois-servers.net]
[com.whois-servers.net]
Whois Server Version 2.0
Domain names in the .com and .net domains can now be registered
with many different competing registrars. Go to http://www.internic.net
for开发者_运维问答 detailed information.
Domain Name: EXAMPLE.COM
Registrar: RESERVED-INTERNET ASSIGNED NUMBERS AUTHORITY
Whois Server: whois.iana.org
Referral URL: http://res-dom.iana.org
Name Server: A.IANA-SERVERS.NET
Name Server: B.IANA-SERVERS.NET
Status: clientDeleteProhibited
Status: clientTransferProhibited
Status: clientUpdateProhibited
Updated Date: 26-mar-2004
Creation Date: 14-aug-1995
Expiration Date: 13-aug-2011
>>> Last update of whois database: Tue, 17 Aug 2010 02:23:52 UTC <<<
Question
I want to know
- Whats the difference between different services (urls) ?
- How many values can come for Status (clientDeleteProhibited, clientTransferProhibited, clientUpdateProhibited) ?
- I Need full information about every field of reply text
Referance
- Whois Specifications
- Whois Policy
- Whois
whois.iana.org is root whois server, it returns whois server of zone that you specified, e.g. for .com, .net, .us, .ca etc; for each of this zone whois server is different and the trick is that reply text/format about domain info is not the same everywhere. See response format for google.us and google.ca as example:
http://domain-records-lookup.com/whois/google.us
http://domain-records-lookup.com/whois/google.ca
Also there is rfc3912 for whois that may be helpful for you.
Please have a look at these 2 other answers of me that will give you further information on your first point:
- https://unix.stackexchange.com/a/407030/211833
- https://webmasters.stackexchange.com/a/111639/75842
For status values, it again depends on the TLD, but for gTLDs please have a look at: https://www.icann.org/epp with a full list of statuses and explanations.
As for the explanations of each field, again this depends on the TLD, but for gTLDs you will find answers here: https://www.icann.org/rdds-labeling-display
For other TLDs you will need to search for documentation on the relevant registry website.
精彩评论