0.1.1 • Published 5 years ago

whos v0.1.1

Weekly downloads
4
License
BSD-3-Clause
Repository
github
Last release
5 years ago

whos

is a simple whois tool. It requires network and socket, of course.

Install

yarn add whos

Usage

import whos from 'whos'
async function() {
  let whoisResult = await whos('github.com')
  doAwesomethingWith(whoisResult)
)

API

whos(name, requireRaw)

Returns an object containing key value pairs in the "raw" result returned by server, or null if nothing is found. If the requireRaw flag is set, the raw result is returned instead.

For example, $ whois github.com returns:

$ whois github.com
[Querying whois.iana.org:43 'github.com']
[Redirected to whois.verisign-grs.com]
[Querying whois.verisign-grs.com:43 'github.com']
[whois.verisign-grs.com]
   Domain Name: GITHUB.COM
   Registry Domain ID: 1264983250_DOMAIN_COM-VRSN
   Registrar WHOIS Server: whois.markmonitor.com
   Registrar URL: http://www.markmonitor.com
   Updated Date: 2017-06-26T16:02:39Z Creation Date: 2007-10-09T18:20:50Z
   Registry Expiry Date: 2020-10-09T18:20:50Z
   Registrar: MarkMonitor Inc.
   Registrar IANA ID: 292
   Registrar Abuse Contact Email: abusecomplaints@markmonitor.com
   Registrar Abuse Contact Phone: +1.2083895740
   Domain Status: clientDeleteProhibited https://icann.org/epp#clientDeleteProhibited
   Domain Status: clientTransferProhibited https://icann.org/epp#clientTransferProhibited
   Domain Status: clientUpdateProhibited https://icann.org/epp#clientUpdateProhibited
   Name Server: NS-1283.AWSDNS-32.ORG
   Name Server: NS-1707.AWSDNS-21.CO.UK
   Name Server: NS-421.AWSDNS-52.COM
   Name Server: NS-520.AWSDNS-01.NET
   Name Server: NS1.P16.DYNECT.NET
   Name Server: NS2.P16.DYNECT.NET
   Name Server: NS3.P16.DYNECT.NET
   Name Server: NS4.P16.DYNECT.NET
   DNSSEC: unsigned
   URL of the ICANN Whois Inaccuracy Complaint Form: https://www.icann.org/wicf/
>>> Last update of whois database: 2019-03-05T18:55:54Z <<<                 
For more information on Whois status codes, please visit https://icann.org/epp                                                                                                                                                      
blah blah blah from VeriSign which is so long that I don't put it here. You can check it out yourself.

Notice the redirect. Now compare whos("github.com"):

> whos("github.com").then(console.log)
{ domainName: 'github.com',
  registryDomainId: '1264983250_DOMAIN_COM-VRSN',
  registrarWhoisServer: 'whois.markmonitor.com',
  registrarUrl: 'http://www.markmonitor.com',
  updatedDate: '2017-06-26T16:02:39Z',
  creationDate: '2007-10-09T18:20:50Z',
  registryExpiryDate: '2020-10-09T18:20:50Z',
  registrar: 'MarkMonitor Inc.',
  registrarIanaId: '292',
  registrarAbuseContactEmail: 'abusecomplaints@markmonitor.com',
  registrarAbuseContactPhone: '+1.2083895740',
  domainStatus:
   [ 'clientDeleteProhibited',
     'clientTransferProhibited',
     'clientUpdateProhibited' ],
  nameServers:
   [ 'ns-1283.awsdns-32.org',
     'ns-1707.awsdns-21.co.uk',
     'ns-421.awsdns-52.com',
     'ns-520.awsdns-01.net',
     'ns1.p16.dynect.net',
     'ns2.p16.dynect.net',
    'ns3.p16.dynect.net',
     'ns4.p16.dynect.net' ],
  dnssec: 'unsigned',
}

That's called structured data. Yay.

TODO

  • TLD specific handlers
    • .UK whois result put attribute name and value on different lines
    • Some TLDs (i.e. .FR) have multiple values of same name which belong to different groups
  • Attribute name (key) normalization
  • Clean up results (useless attributes, etc.)

©?

Made by Gu Queyan, licensed under BSD 3-Clause. Contributions are welcome and appreciated.