Linux how to whois query other gTLDs such as .club solution

whois in Linux is incredibly out of date and does not seem to recognize most new TLDs domains, but there is a quick and easy tip/hack/tweak for this.

An example of new TLD's site as .review .site .club

whois somesite.club

No whois server is known for this kind of object.
 

bash to the rescue

Now I did try to apply this in .bashrc but DO NOT!  I think the * wildcard or something else in the code causes a recursive infinite loop that will slow or cash your computer. (I am not kidding I had a load of 1000!).

1.) The bash script (finds the whois server for the .tld and queries it):

#!/bin/bash
server=$1
whois -h `whois "$1" -h whois.iana.org| grep whois\:| sed -e s/whois\:\\s*//` "$1"

2.) Save it to a file in your home ~/whoisserver.sh

3.) Edit ~/.bashrc

Add the following:

function whois() { /home/yourdir/whoisserver.sh $1; }

To apply instantly in your current shell/bash:

source .bashrc

The reason I used a function is because it supports variables whereas a bash "alias" does not.


Tags:

linux, whois, query, gtlds, solutionwhois, tlds, domains, hack, tweak, tld, somesite, server, bash, bashrc, wildcard, recursive, infinite, queries, bin, quot, iana, org, grep, sed, whoisserver, sh, edit, yourdir, instantly, shell, supports, variables, whereas, alias,

Latest Articles

  • Warning: The driver descriptor says the physical block size is 2048 bytes, but Linux says it is 512 bytes. solution
  • Cisco How To Use a Third Party SIP Phone (eg. Avaya, 3CX)
  • Cisco Unified Communication Manager (CUCM) - How To Add Phones
  • pptp / pptpd not working in DD-WRT iptables / router
  • systemd-journald high memory usage solution
  • How to Install FreePBX 17 in Linux Debian Ubuntu Mint Guide
  • How To Install Cisco's CUCM (Cisco Unified Communication Manager) 12 Guide
  • Linux Ubuntu Redhat How To Extract Images from PDF
  • Linux and Windows Dual Boot Issue NIC Won't work After Booting Windows
  • Cisco CME How To Enable ACD hunt groups
  • How to install gns3 on Linux Ubuntu Mint
  • How to convert audio for Asterisk .wav format
  • Using Cisco CME Router with Asterisk as a dial-peer
  • Cisco CME How To Configure SIP Trunk VOIP
  • Virtualbox host Only Network Error Failed to save host network interface parameter - Cannot change gateway IP of host only network
  • Cisco CME and C7200 Router Testing and Learning Environment on Ubuntu 20+ Setup Tutorial Guide
  • Abusive IP ranges blacklist
  • How to Install Any OS on a Physical Drive from Windows Using VMware Workstation (Linux, Windows, BSD)
  • CDN Cloudflare how to set and preserve the real IP of the client without modifying application code on Apache
  • CentOS 7 fix Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=container error was 14: curl#6 -