Jswhois - Whois lookup results in json format

jswhois -- whois lookup results in json format

jswhois(1) is a tool to look up and print WHOIS results in JSON format.

For a bit more context around WHOIS and the unstructured nature this tool tries to wrangle, please see: https://www.netmeister.org/blog/whois.html

Installation

jswhois(1) is written in Go, so you'll need that.

Other than that, you can install it by running make install.

The Makefile defaults to '/usr/local' as the prefix, but you can change that, if you like:

$ make PREFIX=~ install

NAME
     jswhois -- whois lookup results in json format

SYNOPSIS
     jswhois [-QRVlv] [-h host] [-p port] domain

DESCRIPTION
     The jswhois tool performs whois(1) lookups and prints results in JSON
     format.

     Since the WHOIS protocol notoriously does not include a specification of
     the WHOIS data's format or how recursive discovery should be handled, the
     results -- much like the results of the normal whois(1) command -- tend
     to vary significantly.

OPTIONS
     The following options are supported by jswhois:

     -Q	      Do a quick lookup; jswhois will not attempt to follow referrals
	      to other whois servers.  This is the default if a server is
	      explicitly specified via the -h flag.  See also the -R option.

     -R	      Do a recursive lookup; jswhois will attempt to follow referrals
	      to other whois servers.  This is the default if -h is not speci-
	      fied.  See also the -Q option.

     -V	      Print version information and exit.

     -h host  Use the specified host instead of the default (whois.iana.org).

     -l	      Only print results from the last WHOIS server queried.

     -p port  Connect to the whois server on port. If this option is not spec-
	      ified, jswhois defaults to port 43.

     -v	      Be verbose.  Can be specified multiple times.

DETAILS
     WHOIS information is notoriously unpredictably structured and hard to
     parse.  In order to process WHOIS data with even a shred of hope of not
     getting lost in terrible regular expressions and shell pipelines and yet
     without relying on proprietary APIs jswhois will attempt to reformat the
     text output in a coherent JSON object.

     The query for any domain will always begin at 'whois.iana.org' and then
     recurse as per the data encountered.  The resulting JSON document will
     then contain nested structures indexed by the name of the WHOIS server in
     question.

     Since the data is fundamentally unstructured, attempts to stuff them into
     JSON formatting is made as outlined below:

     o	 repeated fields are turned into a list
     o	 a chain of WHOIS servers queried is added to the top object

EXAMPLES
     To display the WHOIS information for the domain 'netmeister.org':

	   $ jswhois netmeister.org | jq
	   {
	     "query": "netmeister.org",
	     "chain": [
	       "whois.iana.org",
	       "whois.pir.org",
	       "whois.gandi.net"
	     ],
	     "whois.iana.org": {
	       "domain": "ORG"
	       "organisation": {
		 "name": "Public Interest Registry (PIR)",
		 "address": [
		   "11911 Freedom Drive 10th Floor,",
		   "Suite 1000",
		   "Reston, VA 20190",
		   "United States"
		 ]
	       },
	       "contact": [ {
		 "name": "administrative",
		 ...
	       }, ... ]
	     }
	     "whois.pir.org": {
	       "Domain Name": "NETMEISTER.ORG",
	       ...
	     },
	     "whois.gandi.net": {
	       "Domain Name": "netmeister.org",
	       ...
	     }
	   }

EXIT STATUS
     The jswhois utility exits 0 on success, and >0 if an error occurs.

SEE ALSO
     whois(1), jq(1)

HISTORY
     jswhois was originally written by Jan Schaumann <[email protected]>
     in December 2021.

BUGS
     Please file bugs and feature requests by emailing the author.
Owner
Jan Schaumann
https://twitter.com/jschauma
Jan Schaumann
Similar Resources

Fetches one or more DNS zones via AXFR and dumps in Unix hosts format for local use

axfr2hosts About axfr2hosts is a tool meant to do a DNS zone transfer in a form of AXFR transaction of one or more zones towards a single DNS server a

Aug 9, 2022

Go support for Protocol Buffers - Google's data interchange format

Go support for Protocol Buffers - Google's data interchange format Google's data interchange format. Copyright 2010 The Go Authors. https://github.com

Dec 15, 2021

A simple command-line tool to manage ADRs in markdown format

Architecture Decision Records A simple command-line tool to manage ADRs in markdown format. Usage adr init [path] Initialize the ADR path and create a

Feb 10, 2022

A yaml data-driven testing format together with golang testing library

Specified Yaml data-driven testing Specified is a yaml data format for data-driven testing. This enforces separation between feature being tested the

Jan 9, 2022

rpc/v2 support for JSON-RPC 2.0 Specification.

rpc rpc/v2 support for JSON-RPC 2.0 Specification. gorilla/rpc is a foundation for RPC over HTTP services, providing access to the exported methods of

Jul 4, 2021

protobuf ではなく JSON でやり取りするファイルを出力する protoc プラグイン

protoc-gen-jsonif proto ファイルから、JSON フォーマットでやりとりする型定義ファイルを出力する protoc プラグインです。 proto ファイルで言語を越えて型定義が出来るのはとても良い しかし protobuf ライブラリを入れるのが面倒 今のプロジェクトには既に

Feb 28, 2022

Clients able to speak JSON over HTTP to the server

Location History Server How to run: Call the make run command. Clients able to speak JSON over HTTP to the server. There are three endpoints supported

Nov 4, 2021

Json to rpc example with envoy, go, grpc, nats

grpc-nats-envoy json to rpc example with envoy, go, grpc, redis This repo is a mirror of https://github.com/charlesonunze/grpc-redis-envoy-example It

Dec 7, 2021

This small service will pong the headers provided in the request as json response

This small service will pong the headers provided in the request as json response server will run on port 5000 content will be served at path /request

Dec 9, 2021
Comments
  • .org format has changed?

    .org format has changed?

    Hi,

    I've been working on some whois related stuff (https://github.com/Evolix/chexpire) and a few days ago I've noticed some errors when parsing .org whois answers.

    I don't know if your tool is affected or not, but I remembered that it existed, so I figured that you might be interrested.

    For example here is a test file that used to work :

    % IANA WHOIS server
    % for more information on IANA, visit http://www.iana.org
    % This query returned 1 object
    
    refer:        whois.pir.org
    
    domain:       ORG
    
    organisation: Public Interest Registry (PIR)
    address:      1775 Wiehle Avenue
    address:      Suite 102A
    address:      Reston Virginia 20190
    address:      United States
    
    contact:      administrative
    name:         Director of Operations, Compliance and Customer Support
    organisation: Public Interest Registry (PIR)
    address:      1775 Wiehle Avenue
    address:      Reston Virginia 20190
    address:      United States
    phone:        +1 919 369 4161
    fax-no:       +1 703 889 5779
    e-mail:       [email protected]
    
    contact:      technical
    name:         Senior Director, DNS Infrastructure Group
    organisation: Afilias
    address:      Building 3, Suite 105
    address:      300 Welsh Road
    address:      Horsham, Pennsylvania 19044
    address:      United States
    phone:        +1 215.706.5700
    fax-no:       +1 215.706.5701
    e-mail:       [email protected]
    
    nserver:      A0.ORG.AFILIAS-NST.INFO 199.19.56.1 2001:500:e:0:0:0:0:1
    nserver:      A2.ORG.AFILIAS-NST.INFO 199.249.112.1 2001:500:40:0:0:0:0:1
    nserver:      B0.ORG.AFILIAS-NST.ORG 199.19.54.1 2001:500:c:0:0:0:0:1
    nserver:      B2.ORG.AFILIAS-NST.ORG 199.249.120.1 2001:500:48:0:0:0:0:1
    nserver:      C0.ORG.AFILIAS-NST.INFO 199.19.53.1 2001:500:b:0:0:0:0:1
    nserver:      D0.ORG.AFILIAS-NST.ORG 199.19.57.1 2001:500:f:0:0:0:0:1
    ds-rdata:     9795 7 2 3922b31b6f3a4ea92b19eb7b52120f031fd8e05ff0b03bafcf9f891bfe7ff8e5
    ds-rdata:     9795 7 1 364dfab3daf254cab477b5675b10766ddaa24982
    
    whois:        whois.pir.org
    
    status:       ACTIVE
    remarks:      Registration information: http://www.pir.org
    
    created:      1985-01-01
    changed:      2016-05-10
    source:       IANA
    
    Domain Name: DOMAIN.ORG
    Registry Domain ID: D1511762-LROR
    Registrar WHOIS Server: whois.domain.com
    Registrar URL: www.domain.com
    Updated Date: 2018-04-02T03:47:23Z
    Creation Date: 1995-04-30T04:00:00Z
    Registry Expiry Date: 2019-05-01T04:00:00Z
    Registrar Registration Expiration Date:
    Registrar: Domain.com, LLC
    Registrar IANA ID: 886
    Registrar Abuse Contact Email: [email protected]
    Registrar Abuse Contact Phone: +1.6022262389
    Reseller:
    Domain Status: clientDeleteProhibited https://icann.org/epp#clientDeleteProhibited
    Domain Status: clientTransferProhibited https://icann.org/epp#clientTransferProhibited
    Domain Status: clientUpdateProhibited https://icann.org/epp#clientUpdateProhibited
    Registrant Organization: Endurance International Group West, Inc
    Registrant State/Province: MA
    Registrant Country: US
    Name Server: DNS1.DOMAINBANK.COM
    Name Server: DNS2.DOMAINBANK.COM
    DNSSEC: unsigned
    URL of the ICANN Whois Inaccuracy Complaint Form: https://www.icann.org/wicf/
    >>> Last update of WHOIS database: 2018-06-05T14:44:20Z <<<
    
    Domain Name: DOMAIN.ORG
    Registry Domain ID: D1511762-LROR
    Registrar WHOIS Server: whois.domain.com
    Registrar URL: www.domain.com
    Updated Date: 2018-04-02T03:47:23
    Creation Date: 1995-04-29T04:00:00
    Registrar Registration Expiration Date: 2019-05-01T04:00:00
    Registrar: Domain.com, LLC
    Registrar IANA ID: 886
    Reseller: Domain Name Holding Company, Inc
    Domain Status: clientDeleteProhibited https://icann.org/epp#clientDeleteProhibited
    Domain Status: clientTransferProhibited https://icann.org/epp#clientTransferProhibited
    Domain Status: clientUpdateProhibited https://icann.org/epp#clientUpdateProhibited
    Registry Registrant ID: 
    Registrant Name: Data Protected Data Protected
    Registrant Organization: Data Protected
    Registrant Street: 123 Data Protected 
    Registrant City: Toronto
    Registrant State/Province: ON
    Registrant Postal Code: M6K 3M1
    Registrant Country: CA
    Registrant Phone: +1.0000000000
    Registrant Phone Ext: 
    Registrant Fax: +1.0000000000
    Registrant Fax Ext: 
    Registrant Email: [email protected]
    Registry Admin ID: 
    Admin Name: Data Protected Data Protected
    Admin Organization: Data Protected
    Admin Street: 123 Data Protected 
    Admin City: Toronto
    Admin State/Province: ON
    Admin Postal Code: M6K 3M1
    Admin Country: CA
    Admin Phone: +1.0000000000
    Admin Phone Ext: 
    Admin Fax: +1.0000000000
    Admin Fax Ext: 
    Admin Email: [email protected]
    Registry Tech ID: 
    Tech Name: Data Protected Data Protected
    Tech Organization: Data Protected
    Tech Street: 123 Data Protected 
    Tech City: Toronto
    Tech State/Province: ON
    Tech Postal Code: M6K 3M1
    Tech Country: CA
    Tech Phone: +1.0000000000
    Tech Phone Ext: 
    Tech Fax: +1.0000000000
    Tech Fax Ext: 
    Tech Email: [email protected]
    Name Server: dns1.domainbank.com
    Name Server: dns2.domainbank.com
    
    Registrar Abuse Contact Email: [email protected]
    Registrar Abuse Contact Phone: +1.6027165396
    URL of the ICANN WHOIS Data Problem Reporting System: http://wdprs.internic.net/
    >>> Last update of WHOIS database: 2018-04-02T03:47:23 <<<
    

    And now I get something like this :

    Domain Name: domain.org
    Registry Domain ID: 917361e9a4034753ad252db587e82521-LROR
    Registrar WHOIS Server: whois.gandi.net
    Registrar URL: http://www.gandi.net
    Updated Date: 2022-06-03T22:27:15Z
    Creation Date: 2002-11-18T18:08:13Z
    Registry Expiry Date: 2022-11-18T18:08:13Z
    Registrar: Gandi SAS
    Registrar IANA ID: 81
    Registrar Abuse Contact Email: [email protected]
    Registrar Abuse Contact Phone: +33.170377661
    Domain Status: clientTransferProhibited https://icann.org/epp#clientTransferProhibited
    Registry Registrant ID: REDACTED FOR PRIVACY
    Registrant Name: REDACTED FOR PRIVACY
    Registrant Organization: Institut Molinari
    Registrant Street: REDACTED FOR PRIVACY
    Registrant City: REDACTED FOR PRIVACY
    Registrant State/Province: 
    Registrant Postal Code: REDACTED FOR PRIVACY
    Registrant Country: BE
    Registrant Phone: REDACTED FOR PRIVACY
    Registrant Phone Ext: REDACTED FOR PRIVACY
    Registrant Fax: REDACTED FOR PRIVACY
    Registrant Fax Ext: REDACTED FOR PRIVACY
    Registrant Email: Please query the RDDS service of the Registrar of Record identified in this output for information on how to contact the Registrant, Admin, or Tech contact of the queried domain name.
    Registry Admin ID: REDACTED FOR PRIVACY
    Admin Name: REDACTED FOR PRIVACY
    Admin Organization: REDACTED FOR PRIVACY
    Admin Street: REDACTED FOR PRIVACY
    Admin City: REDACTED FOR PRIVACY
    Admin State/Province: REDACTED FOR PRIVACY
    Admin Postal Code: REDACTED FOR PRIVACY
    Admin Country: REDACTED FOR PRIVACY
    Admin Phone: REDACTED FOR PRIVACY
    Admin Phone Ext: REDACTED FOR PRIVACY
    Admin Fax: REDACTED FOR PRIVACY
    Admin Fax Ext: REDACTED FOR PRIVACY
    Admin Email: Please query the RDDS service of the Registrar of Record identified in this output for information on how to contact the Registrant, Admin, or Tech contact of the queried domain name.
    Registry Tech ID: REDACTED FOR PRIVACY
    Tech Name: REDACTED FOR PRIVACY
    Tech Organization: REDACTED FOR PRIVACY
    Tech Street: REDACTED FOR PRIVACY
    Tech City: REDACTED FOR PRIVACY
    Tech State/Province: REDACTED FOR PRIVACY
    Tech Postal Code: REDACTED FOR PRIVACY
    Tech Country: REDACTED FOR PRIVACY
    Tech Phone: REDACTED FOR PRIVACY
    Tech Phone Ext: REDACTED FOR PRIVACY
    Tech Fax: REDACTED FOR PRIVACY
    Tech Fax Ext: REDACTED FOR PRIVACY
    Tech Email: Please query the RDDS service of the Registrar of Record identified in this output for information on how to contact the Registrant, Admin, or Tech contact of the queried domain name.
    Name Server: ns-155-a.gandi.net
    Name Server: ns-200-b.gandi.net
    Name Server: ns-89-c.gandi.net
    DNSSEC: unsigned
    URL of the ICANN Whois Inaccuracy Complaint Form: https://www.icann.org/wicf/
    >>> Last update of WHOIS database: 2022-06-12T23:04:05Z <<<
    
    For more information on Whois status codes, please visit https://icann.org/epp
    
    Terms of Use: Access to Public Interest Registry WHOIS information is provided to assist persons in determining the contents of a domain name registration record in the Public Interest Registry registry database. The data in this record is provided by Public Interest Registry for informational purposes only, and Public Interest Registry does not guarantee its accuracy. This service is intended only for query-based access. You agree that you will use this data only for lawful purposes and that, under no circumstances will you use this data to (a) allow, enable, or otherwise support the transmission by e-mail, telephone, or facsimile of mass unsolicited, commercial advertising or solicitations to entities other than the data recipient's own existing customers; or (b) enable high volume, automated, electronic processes that send queries or data to the systems of Registry Operator, a Registrar, or Donuts except as reasonably necessary to register domain names or modify existing registrations. All rights reserved. Public Interest Registry reserves the right to modify these terms at any time. By submitting this query, you agree to abide by this policy.  The Registrar of Record identified in this output may have an RDDS service that can be queried for additional information on how to contact the Registrant, Admin, or Tech contact of the queried domain name.
    
  • Build steps for jswhois don't work out of the box for jswhois executable

    Build steps for jswhois don't work out of the box for jswhois executable

    Great work on jswhois, nice tool. Thanks!

    It looks like a built copy of the jswhois executable has been checked into git. This means that cloning this repo and running make install does not work for me and anyone not using a Mac (I think), as this executable is not rebuilt.

    Contrary to the instructions in the README, I had to run make clean first to delete and force it to be rebuilt.

    I think it would be great to make that clearer. It works fine on Linux otherwise for me. I would suggest perhaps you don't want to check in the built program at all? That might be something better off .gitignored, or added as a GitHub release.

Related tags
concurrent recursive whois resolution

drwho - concurrent 'whois' queries given a set of ip addresses (v4 and v6), concurrently queries whois servers about them. example populate a file wit

Dec 28, 2021
get WHOIS with library, command or through HTTP server

Go Whois Provide WHOIS library, command line tool and server with restful APIs to query whois information for domains and IPs. It's also available to

Oct 24, 2022
Fast IP to CIDR lookup in Golang
Fast IP to CIDR lookup in Golang

cidranger Fast IP to CIDR block(s) lookup using trie in Golang, inspired by IPv4 route lookup linux. Possible use cases include detecting if a IP addr

Dec 30, 2022
DNS lookup service with golang
DNS lookup service with golang

dns-lookup-service Dev Setup git clone https://github.com/philip1986/dns-lookup-service.git cd dns-lookup-service docker-compose up --build Load the

Nov 18, 2022
Go package provides a fast lookup of country, region, city, latitude, longitude, ZIP code, time zone, ISP, domain name,

IP2Location Go Package This Go package provides a fast lookup of country, region, city, latitude, longitude, ZIP code, time zone, ISP, domain name, co

Jan 8, 2023
Generate HTTP load and plot the results in real-time
Generate HTTP load and plot the results in real-time

ali A load testing tool capable of performing real-time analysis, inspired by vegeta and jplot. ali comes with an embedded terminal-based UI where you

Jan 6, 2023
Microservice on IPv4: 3000 port without database. Upon request, returns the source JSON in the desired format
Microservice on IPv4: 3000 port without database. Upon request, returns the source JSON in the desired format

?? Этапы V1.0 Микросервис на IPv4:3000 порту без базы данных. По запросу возвращ

Dec 22, 2021
go-jsonc provides a way to work with commented json by converting it to plain json.

JSON with comments for GO Decodes a "commented json" to "json". Provided, the input must be a valid jsonc document. Supports io.Reader With this, we c

Apr 6, 2022
IPIP.net officially supported IP database ipdb format parsing library

IPIP.net officially supported IP database ipdb format parsing library

Dec 27, 2022
Protocol Buffers - Google's data interchange format

Protocol Buffers - Google's data interchange format Copyright 2008 Google Inc. https://developers.google.com/protocol-buffers/ Overview Protocol Buffe

Jan 3, 2023