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-06-12)

428.   What is emo surfing (emosurfing)?   [jake/2006-01-21]
427.   What is ego surfing?   [jake/2006-01-21]
426.   what is pair programming or what is therapy programming?   [jake/2005-08-26]
413.   How can I solve Cisco Catalyst 3550 series issues where a port seems to have died?   [jake/2004-08-23]
404.   How can I limit the ammount of bandwidth rsync over ssh (or anything else) uses, without a complicated firewall solution?   [leif/2004-02-06]
401.   What is the Fly Over Zone?   [jake/2004-01-28]
347.   How can I boot KNOPPIX off my hard drive?   [strick/2003-02-15] ( jake/2003-02-20 )
334.   How can you stop neutrinos?   [strick/2004-07-19]
322.   how do i verify an address in sendmail?   [jesse/2002-08-30]
315.   How the do you crack (802.11b) WEP keys in linux? (and other havoc)   [jake/2003-01-07]
303.   Is Red Bull really made from bull testicles?   [strick/2002-02-03]
226.   How do you eat vegetarian in central Texas?   [combee/2005-04-08]
116.   where does r0ss come from?   [xenocide/2000-09-10]
93.   Where can I find a GPLed Z80 assembler / disassembler for Linux and DOS?   [rupe/2000-05-11]
87.   How do i OPT OUT of doubleclick's user-tracking cookies?   [strick/2000-05-11]
82.   Can Mice Fly ?   [philbert2k/2000-04-27]
42.   What is there worth seeing in the city of Louisville, Kentucky?   [chota/2001-05-26]
17.   How can I make a didgeridoo for traveling?   [ult/2002-04-20]