安装步骤
- 執行 nslookup,系統回應「沒有這個指令」:
$ nslookup -bash: nslookup: command not found
- 直覺地用 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
- 我們可以加 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
- 雖然第一時間也是查不到,不過在上面遺留的訊息中, 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
- 事不宜遲,咱們快點安裝吧:
PS. 連帶的 dig 與 host 也存在於 bind-utils 套件裡$ yum install bind-utils