46

How can I look up new TLDs, such as .email, .guru, etc., using the whois command in linux?

Running whois on a new TLD only gives the response:

No whois server is known for this kind of object.

11 Answers 11

43

You can manually configure the whois servers for the new TLDs.

Just create the file /etc/whois.conf and add the following content and you will be able to look up the new TLDs:

whois.conf (Github Mirror: whois.conf)

The whois.conf is using regular expressions.

  • 1
    Wow, thanks! Can you tell me what source you get this information from? I imagine this list will become dated over time. – Paul Jun 16 '14 at 18:13
  • 2
    I scripted harvesting the WHOIS servers from the latest IANA data and have updated this answer. – Royce Williams Jul 30 '14 at 23:03
  • 2
    Different versions of whois have different snapshots of whois servers, so different people would need different lists -- especially if they're stuck on an older distro for some reason. Using the entire list every time makes it work for everyone. Also, it is much easier to simply harvest all of them. :-) – Royce Williams Jul 31 '14 at 17:16
  • 1
    @TomBrossman I'm not completely sure why this is and I haven't looked into it any further than to discover that it has something to do with the lookup not going to the registrar level. If you use the gwhois.org tool from one of the below answers, you can see this illustrated much better. – Paul Mar 11 '15 at 20:22
  • 3
    @TomBrossman Correct. There are different Whois Servers for .com domains. Maybe it's possible to enter all of these in the whois.conf. The easiest way is probably to just remove the .com entry. – thde Mar 12 '15 at 12:54
14

You can easily get the right whois server directly from IANA without editing additional files or tables.

Example for ".de" TLD

Linux, OSX (and compatible):

whois -h whois.iana.org .de |
  egrep -e '^whois:' |
  sed -e 's/[[:space:]][[:space:]]*/ /g' |
  cut -d " " -f 2

Have fun

  • I wish your answer were upvoted much more; this is a perfect and correct generalized solution. No hard-coding should be needed (otherwise every OS would need to hard-code WHOIS servers for every new TLD!). Why this isn't the default behavior for the whois utility, I'm not sure (maybe to reduce load?). Anyway, props and thank you. – apinstein Jul 11 '16 at 4:00
  • 2
    Querying a domain would work like this using your idea: whois -h $(whois -h whois.iana.org .TLD | grep '^whois:' | sed 's/whois:\s*//') example.TLD. Interestingly though, it's sufficient to use whois.nic.TLD as a database host for most (or maybe all?) TLD's, as pointed out by @Andrew. – Peterino Aug 11 '16 at 9:30
  • This seems not to work for all TLD's. For .tube the responsible server is not published. Probably because the IANA server is responsible as whois -h whois.iana.org nic.tube works. – thde Jan 29 at 14:41
11

Most whois clients hard-code the TLD whos servers, instead of actively retrieving the whois server from IANA when performing for a TLD that is not already known to the client.

I have built my own online whois lookup tool you can use http://gwhois.org/ that supports all TLDs and IP addresses since all lookups start at IANA and then traverse to the registry and registrar as needed.

I have also spent a lot of time building an intelligent whois parser that displays the whois data in a user-friendly manner.

Example screenshots:

screenshot

screenshot 2

  • Thank you for this, since I don't run Ruby, this answer would work better for me. I run Ubuntu Server 12.04 and it looks like the gwhois package requires an additional 25 packages to be installed from official repository. Not that I would miss the ~4.4MB of storage, are all these really necessary for the package to run correctly? – Paul May 25 '14 at 21:32
  • Oh. Gwhois.org is not related to the 'gwhois' packages on Linux. Sorry for the confusion – iglvzx May 25 '14 at 21:33
  • Okay, that can work, but no command line tool? I'm hoping to solve the command line issue somehow. – Paul May 25 '14 at 21:37
  • 1
    Yeah. The main reason why I decided to build my own whois tool was because I was not satisfied with any of the solutions already out there. :) – iglvzx May 25 '14 at 21:47
  • 2
    @iglvzx I like your tool. Have you thought of open-sourcing the code so that we can activately make changes to the app? – David Okwii Jul 18 '16 at 11:43
11

This appears to work for most new tlds:

Server hostname is in the form: whois.nic.newtldname

e.g.:

whois -h whois.nic.host example.host

"This name is reserved by the Registry in accordance with ICANN Policy." etc etc etc

Also, browsing to http://nic.newtldname typically takes you to the Registry / Launch page.

  • Fantastic! Why does this work even though the hosts officially listed by IANA are different for most domain registries? Is this documented somewhere, i.o.w. is this officially supported by IANA or ICANN? -- The dynamic version of your solution would be whois -h $(whois -h whois.iana.org .TLD | grep '^whois:' | sed 's/whois:\s*//') example.TLD – Peterino Aug 11 '16 at 9:17
  • 1
    Do you know of any other whois servers that accept the TLD extension to query for that TLD? I know of two: whois.nic.$ext and $ext.whois-servers.net -- I'm looking for others to add to my list. – chovy Feb 25 '17 at 5:02
5

If you are using the standard linux client, the definitions have not been updated yet to include the new TLDS.

You have two possible solutions:

  1. Grab the list of all new gTLDs and pass the whois host as parameter to the whois client
  2. Use an alternative client. I'm currently doing my best to keep the Ruby WHOIS client in sync with the new gTLDs, so you can use it. It also offers a CLI.
  • I'm not sure where to grab a list of all new gTLDs and I'm not sure how to pass the whois host as parameter to the whois client. I don't have Ruby installed on my server. This isn't a good answer. – Paul May 26 '14 at 2:46
  • Here is Simone's list of whois hosts for tlds, here is a copy of the whois man page . – Kelly Thomas May 26 '14 at 4:01
  • IANA's Root Zone Database includes whois servers, along with other information for TLDs. (It's near the bottom of a TLD's entry.) – Matt Nordhoff May 26 '14 at 5:30
2

On OS X, the whois tool doesn't seem to be built with the /etc/whois.conf support (Just like slackware?). The easy way to fix this seems to be to instal the "duped" whois from homebrew. You can do that with

brew tap homebrew/dupes
brew update
brew install whois
brew untap homebrew/dupes

That way, it will use a updated list of whois servers (But I only tested with .so and .ninja domains).

  • Good to know this. A one liner to install updated whois CLI is brew install homebrew/dupes/whois – user124460 Jun 5 '15 at 23:07
1

One way is to use TLD.whois-servers.net as the whois server, e.g:

whois -h mobi.whois-servers.net npr.mobi

The whois-server.net domain (run by CenterGate LLC, no affiliation) contains a hopefully up-to-date list of DNS CNAME redirects to official TLD whois servers, e.g:

dig mobi.whois-servers.net
...
;; ANSWER SECTION:
mobi.whois-servers.net. 146     IN      CNAME   whois.dotmobiregistry.net.
  • In most cases this works. There's even a shorter syntax (at least in OSX): whois -c mobi npr.mobi. Sadly it doesn't work for all domains at the time of writing e.g. whois -c tube nic.tube – thde Jan 29 at 14:34
1

For updating your /etc/whois.conf you can use a script like

/*
 * Usage : node generateWhoisConf.js > /etc/whois.conf
 */

var json = require('comment-json');
var request = require('request');

request('https://github.com/weppos/whois/raw/master/data/tld.json', function(error, response, body){
  var obj = json.parse(body);
  Object.keys(obj).forEach(function(key){
    if(obj[key].host){
      console.log(key.replace(/\./g,'\\.') + '$ ' + obj[key].host);
    }
  });
});

https://gist.github.com/HugoPoi/4694a99f5a9d9b2c558557bbdd113f54

This other github repository provide good data about whois server https://github.com/whois-server-list/whois-server-list

  • Welcome to Super User! Please quote the essential parts of the answer from the reference link(s), as the answer can become invalid if the linked page(s) change. – DavidPostill Jul 4 '16 at 9:15
0

My solution was not very sophisticated. I could not look up a certain TLD under Debian Wheezy or Squeeze, or in OS X El Capitan or Snow Leopard. I found out that I could look up the TLD in Debian Jessie though. On the Debian machines I just grabbed the source for whois for Jessie and built it; works fine now. For OS X, I grabbed a newer version of whois through MacPorts.

0

I had the same problematic server response to one of my requests.

In this case, using the -a switch was simple and worked great:

whois -a [your_request_here]

From man:

[This flag is] understood by whois.ripe.net and some other RIPE-like servers:
-a
    Also search all the mirrored databases. 
0

Or, you can just use a better tool. E.g. GNU jwhois which is flexibly search for appropriate whois server first, then do the actual lookup using that server.

jwhois an improved Whois client capable of selecting Whois server to query based on a flexible configuration file using either regular expressions or CIDR blocks

GNU path : https://ftp.gnu.org/gnu/jwhois/
Github one: https://github.com/jonasob/jwhois

  • Doesn't work for new TLDs. – Paul Mar 3 '18 at 23:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.