At some point in recent history, whois stopped returning registrant contact info for a number of TLDs, including .com*. In Why is 'whois' showing no registrant information?, bu11etpr00f explains that the specific registrar whois server must now be queried directly in order to get registrant contact information, i.e.,
$ whois reddit.com ... Registrar WHOIS Server: whois.markmonitor.com ...
$ whois -h whois.markmonitor.com reddit.com ... Registrant Name: Domain Administrator Registrant Organization: Reddit Inc. Registrant Street: 548 Market St., ...
Rather than running two commands, I cobbled together this oneliner:
$ whois -h $(whois reddit.com | grep 'Registrar WHOIS Server:' | cut -f2- -d:) reddit.com
but quickly realized that I use whois often enough to create a bash function for it.
So I saved this in ~/.bash_profile:
function w2 { whois -h $(whois $1 | grep 'Registrar WHOIS Server:' | cut -f2- -d:) $1 }
then ran source ~/.bash_profile to reload.
Much easier now:
$ w2 reddit.com ... Registrant Name: Domain Administrator Registrant Organization: Reddit Inc. Registrant Street: 548 Market St., ...
* Thanks to Guy at easyDNS for kindly informing me of the difference between thick and thin WHOIS registries. See also Anthony Geoghegan's reply to Why do some domain names have extremely truncated whois information? for more information.
/nix | Nov 14, 2017