Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Does anyone know how to configure the whois command to add in whois servers for the whois command?

FYI: it's not whois, the one that's on OSX. Would have posted in Apple version but figured I'd get more success here...

share|improve this question

2 Answers 2

The Mac OS X whois binary has a lot of options built in, including the -h option which allows you to specify any host you want as a whois server.

     The whois utility looks up records in the databases maintained by several Network Information Centers (NICs).

 The options are as follows:

 -6      Use the IPv6 Resource Center (6bone) database.  It contains network names and addresses for the IPv6 net-
         work.

 -A      Use the Asia/Pacific Network Information Center (APNIC) database.  It contains network numbers used in
         East Asia, Australia, New Zealand, and the Pacific islands.

 -a      Use the American Registry for Internet Numbers (ARIN) database.  It contains network numbers used in
         those parts of the world covered neither by APNIC nor by RIPE.

         (Hint: All point of contact handles in the ARIN whois database end with "-ARIN".)

 -b      Use the Network Abuse Clearinghouse database.  It contains addresses to which network abuse should be
         reported, indexed by domain name.

 -c country-code
         This is the equivalent of using the -h option with an argument of "country-code.whois-servers.net".

 -d      Use the US Department of Defense database.  It contains points of contact for subdomains of .MIL.

 -g      Use the US non-military federal government database, which contains points of contact for subdomains of
         .GOV.

 -h host
         Use the specified host instead of the default variant.  Either a host name or an IP address may be speci-
         fied.

All you need to know is which option corresponds to the whois server you want to search.

If you want to actually add a search option to whois that points to a new server, you'd need the source code so you can recompile it. If you run strings /usr/bin/whois, you'll notice that the servers related to the options listed above are actually hard coded into the binary.

share|improve this answer

whois as bundled with OSX has the -h switch (as shown by Tim), which specifies the host to use. As far as I am aware there is no configuration file where you can permanently set this -- the best alternative is probably to use a shell function similar to the following:

whois() { command whois -h whois.example.com "$@" ; }
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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