by robey

How can I make the "whois" command work like before?

Because there are now more than one domain registration service (DRS), a "whois" query on a domain name just tells you who registered the domain. So you have to do an initial query of:

$ whois myspecialicon.com

and then, once you know the whois server to use, do:

$ whois myspecialicon.com@whois.corenic.net

so it's become a two-step process, which is okay, but it annoys old fogeys like me who are used to being able to find out "whois" info with a single command.

Perl to the rescue! Enter this line into your .bashrc:

function xwhois { whois $1 | perl -le 'while (<>) { chomp; /Whois Server: (\S+)/i && ($server = $1); print; } if ($server) { open(FD, "whois '$1'\@$server|"); while (<FD>) { chomp; print; } }' }

Then you can do it all in one step:

$ xwhois myspecialicon.com

HOORAY POKEY YOU DID IT! CHEESE FOR EVERYONE!

 


 
Read more of   The Yak's Frequently Questioned Answers   (mod.2008-11-08)

406.   What are the different types of Rape Juice(tm) to quench a healthy thirst?   [n0b0dy/2004-03-08] ( leif/2004-03-09 )
362.   How do I make Internet Explorer download more than 2 files at a time?   [matt/2003-06-17] ( strick/2003-06-21 )
321.   what is jesse's first rule of backpacking?   [jesse/2002-08-13]
298.   what is the equivalent to strace on openBSD?   [jesse/2001-12-28]
297.   What are some notable events in Usenet history?   [rupe/2001-12-20]
284.   whats the best way to encode MP3s on linux?   [jesse/2001-11-13]
276.   What is the recipe for Soylent Green yak drink?   [blink/2001-10-02] ( macki/2001-11-05 )
259.   What is #temp   [ross/2001-08-10]
252.   How can I turn an Indigo into an apache based webcam?   [vonguard/2001-06-29]
236.   how do i setup a scroll wheel mouse in xfree86 4.0.x?   [jesse/2001-06-09]
185.   what are some cool domain names?   [jesse/2001-02-26] ( josh/2001-04-03 )
180.   Why is that dwarf always following me?   [vonguard/2001-02-17]
170.   Where can I find the Linux Kernel Wishlist?   [rupe/2001-01-31]
121.   What time is it?   [rupe/2000-09-18] ( josh/2001-04-03 strick/2001-03-10 )
118.   Where can I find out the cost of giving a sasquatch a funeral?   [rupe/2000-09-14]
96.   Where can I find information on in-vehicle computer systems?   [rupe/2000-05-24]
84.   How do I send mail from a Python script?   [rupe/2000-05-10]
61.   Where is strick?   [strick/2001-05-30]