Centos 6 安装nslookup命令

安装步骤

  1. 執行 nslookup,系統回應「沒有這個指令」:
    $ nslookup
    -bash: nslookup: command not found
    
  2. 直覺地用 yum 安裝 nslookup,結果跟你說「套件不存在」:
    $ yum install nslookup
    Loaded plugins: fastestmirror
    Loading mirror speeds from cached hostfile
     * base: mirrors.kernel.org
     * elrepo: ftp.osuosl.org
     * epel: mirrors.kernel.org
     * extras: mirrors.kernel.org
     * rpmforge: mirror.hmc.edu
     * updates: mirrors.kernel.org
    Setting up Install Process
    No package nslookup available.
    Error: Nothing to do
    
  3. 我們可以加 provides 參數查詢 nslookup 存在哪個套件中:
    $ yum provides nslookup
    Loaded plugins: fastestmirror
    Loading mirror speeds from cached hostfile
    * base: mirrors.linode.com
    * epel: mirror.prgmr.com
    * extras: mirrors.linode.com
    * rpmforge: mirror.hmc.edu
    * updates: mirrors.linode.com
    Warning: 3.0.x versions of yum would erroneously match against filenames.
    You can use "*/nslookup" and/or "*bin/nslookup" to get that behaviour
    No Matches found
    
  4. 雖然第一時間也是查不到,不過在上面遺留的訊息中, yum 有進一步顯示說檔案可能藏在 bin 目錄中。我們依樣畫葫蘆:
    $ yum provides *bin/nslookup
    Loaded plugins: fastestmirror
    Loading mirror speeds from cached hostfile
    * base: mirrors.linode.com
    * epel: mirror.prgmr.com
    * extras: mirrors.linode.com
    * rpmforge: mirror.hmc.edu
    * updates: mirrors.linode.com
    32:bind-utils-9.8.2-0.17.rc1.el6_4.6.x86_64 : Utilities for querying DNS name
                                                : servers
    Repo        : base
    Matched from:
    Filename    : /usr/bin/nslookup
    
  5. 事不宜遲,咱們快點安裝吧:
    $ yum install bind-utils
    
    PS. 連帶的 dighost 也存在於 bind-utils 套件裡

转自:
http://www.vixual.net/blog/archives/47

你可能感兴趣的:(Centos 6 安装nslookup命令)