Install whois On CentOS Linux Using Yum Package Manager

Earlier today I needed to lookup the origin of some IP’s and I typically use whois but it wasn’t installed on the CentOS server I was working on. Attempting to install whois failed so below there is information on installing whois using the yum package manager on CentOS.

whois Not Installed On CentOS Linux:

bash

  1. [root@dev ~]# whois
  2. -bash: whois: command not found

Above you can see that the whois command is not currently installed on this CentOS Linux server. Below we describe how to use yum to search for what package installs whois and then we install the correct package.

Use yum whatprovides To See What Installs A Specific Application On CentOS:

bash

  1. [root@dev ~]# yum whatprovides *bin/whois*
  2. Loading "installonlyn" plugin
  3. Setting up repositories
  4. Reading repository metadata in from local files
  5. jwhois.x86_64                            3.2.3-8.el5            base
  6. Matched from:
  7. /usr/bin/whois
  8. [root@dev ~]#

As you can see above the jwhois package installs the whois application. The yum whatprovides command can be very useful for figuring out what package installs a specific application.

Install jwhois Package Via Yum On CentOS Linux:

bash

  1. [root@dev ~]# yum install jwhois
  2. Loading "installonlyn" plugin
  3. Setting up Install Process
  4. Setting up repositories
  5. pgdg83                    100% |=========================| 1.9 kB    00:00
  6. rpmforge                  100% |=========================| 1.1 kB    00:00
  7. base                      100% |=========================| 2.1 kB    00:00
  8. updates                   100% |=========================| 1.9 kB    00:00
  9. addons                    100% |=========================|  951 B    00:00
  10. ruby                      100% |=========================|  951 B    00:00
  11. extras                                                          2.1 kB 00:00
  12. Reading repository metadata in from local files
  13. Parsing package install arguments
  14. Resolving Dependencies
  15. --> Populating transaction set with selected packages. Please wait.
  16. ---> Downloading header for jwhois to pack into transaction set.
  17. jwhois-3.2.3-8.el5.x86_64 100% |=========================| 9.4 kB    00:00
  18. ---> Package jwhois.x86_64 0:3.2.3-8.el5 set to be updated
  19. --> Running transaction check
  20.  
  21. Dependencies Resolved
  22.  
  23. =============================================================================
  24.  Package                 Arch       Version          Repository        Size
  25. =============================================================================
  26. Installing:
  27.  jwhois                  x86_64     3.2.3-8.el5      base               95 k
  28.  
  29. Transaction Summary
  30. =============================================================================
  31. Install      1 Package(s)
  32. Update       0 Package(s)
  33. Remove       0 Package(s)
  34.  
  35. Total download size: 95 k
  36. Is this ok [y/N]: y
  37. Downloading Packages:
  38. (1/1): jwhois-3.2.3-8.el5 100% |=========================|  95 kB    00:00
  39. Running Transaction Test
  40. Finished Transaction Test
  41. Transaction Test Succeeded
  42. Running Transaction
  43.   Installing: jwhois                       ######################### [1/1]
  44.  
  45. Installed: jwhois.x86_64 0:3.2.3-8.el5
  46. Complete!
  47. [root@dev ~]#

Now that jwhois has been installed you should be able to use whois from the CentOS command line as shown in the below example.

Use whois On CentOS Linux:

bash

  1. [root@dev etc]# whois 136.165.238.241
  2. [Querying whois.arin.net]
  3. [whois.arin.net]
  4. #
  5. # Query terms are ambiguous.  The query is assumed to be:
  6. #     "n 136.165.238.241"
  7. #
  8. # Use "?" to get help.
  9. #
  10.  
  11. #
  12. # The following results may also be obtained via:
  13. # http://whois.arin.net/rest/nets;q=136.165.238.241?showDetails=true&showARIN=false
  14. #
  15.  
  16. NetRange:       136.165.0.0 - 136.165.255.255
  17. CIDR:           136.165.0.0/16
  18. OriginAS:
  19. NetName:        UNIV-LOUIS
  20. NetHandle:      NET-136-165-0-0-1
  21. Parent:         NET-136-0-0-0-0
  22. NetType:        Direct Assignment
  23. NameServer:     PAN.LOUISVILLE.EDU
  24. NameServer:     HERMES.LOUISVILLE.EDU
  25. RegDate:        1989-09-04
  26. Updated:        2004-04-20
  27. Ref:            http://whois.arin.net/rest/net/NET-136-165-0-0-1
  28.  
  29. OrgName:        University of Louisville
  30. OrgId:          UNIVER-261
  31. Address:        Information Technology: Communications Services
  32. Address:        University of Louisville
  33. City:           Louisville
  34. StateProv:      KY
  35. PostalCode:     40292
  36. Country:        US
  37. RegDate:        1989-09-04
  38. Updated:        2004-04-15
  39. Ref:            http://whois.arin.net/rest/org/UNIVER-261
  40.  
  41. OrgAbuseHandle: UOFLA-ARIN
  42. OrgAbuseName:   UofL Abuse
  43. OrgAbusePhone:  +1-502-852-1776
  44. OrgAbuseEmail:  abuse@hermes.louisville.edu
  45. OrgAbuseRef:    http://whois.arin.net/rest/poc/UOFLA-ARIN
  46.  
  47. OrgNOCHandle: UOFLN-ARIN
  48. OrgNOCName:   UofL NOC
  49. OrgNOCPhone:  +1-502-852-1776
  50. OrgNOCEmail:  noc@hermes.louisville.edu
  51. OrgNOCRef:    http://whois.arin.net/rest/poc/UOFLN-ARIN
  52.  
  53. OrgTechHandle: UOFLH-ARIN
  54. OrgTechName:   UofL Hostmaster
  55. OrgTechPhone:  +1-502-852-1776
  56. OrgTechEmail:  hostmaster@hermes.louisville.edu
  57. OrgTechRef:    http://whois.arin.net/rest/poc/UOFLH-ARIN
  58.  
  59. RNOCHandle: UOFLN-ARIN
  60. RNOCName:   UofL NOC
  61. RNOCPhone:  +1-502-852-1776
  62. RNOCEmail:  noc@hermes.louisville.edu
  63. RNOCRef:    http://whois.arin.net/rest/poc/UOFLN-ARIN
  64.  
  65. RTechHandle: UOFLH-ARIN
  66. RTechName:   UofL Hostmaster
  67. RTechPhone:  +1-502-852-1776
  68. RTechEmail:  hostmaster@hermes.louisville.edu
  69. RTechRef:    http://whois.arin.net/rest/poc/UOFLH-ARIN
  70.  
  71. RAbuseHandle: UOFLA-ARIN
  72. RAbuseName:   UofL Abuse
  73. RAbusePhone:  +1-502-852-1776
  74. RAbuseEmail:  abuse@hermes.louisville.edu
  75. RAbuseRef:    http://whois.arin.net/rest/poc/UOFLA-ARIN
  76.  
  77. #
  78. # ARIN WHOIS data and services are subject to the Terms of Use
  79. # available at: https://www.arin.net/whois_tou.html
  80. #
  81.  
  82. [root@dev etc]#

The whois application has now been installed and can be used as shown in the above example.

Hacking Exposed: Network Security Secrets and Solutions, Sixth Edition (Paperback)


List Price: $49.99
New From: $5.98 USD In Stock
Used from: $0.01 USD In Stock

High Performance Web Sites: Essential Knowledge for Front-End Engineers (Paperback)


List Price: $29.99 USD
New From: $7.48 USD In Stock
Used from: $0.01 USD In Stock

Share