所属分类: linux&Unix 整理: FengNet.Com 更新日期:2017/12/29 16:46:44 阅读次数:519

Centos 6 安装nslookup命令


安装步骤

執行 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

事不宜遲,咱們快點安裝吧:

$ yum install bind-utils

PS. 連帶的 dig 與 host 也存在於 bind-utils 套件裡

作者:禾白小三飘
链接:https://www.jianshu.com/p/a88d4ec5e407
來源:简书
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。

--------------------------------------------------------------------------------

相关文章
Centos Bind配置完整版 2014/11/10 16:08:33


感性空间
设计&运维
网络技术
休闲娱乐
NetFilter
linux&Unix
网络安全
程序空间
软件考试
RFC&ISO
规划&规范
虚拟&存储
Apple技巧
云计算&大数据



文章搜索



站内搜索