做DNS的人都知道nslookup命令是做什么用的,windows系統自帶的。但是linux系統是不自帶這個命令的,需要人手動安裝。如果您不記得這是哪個軟件包提供這個命令的話,那您還真會有些麻煩了。下面教您如何找到這個命令的軟件包。
命令yum provides */nslookup 就可以找到提供nslookup命令的軟件包了。
[root@localhost ~]# yum provides */nslookup
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* epel: mirror01.idc.hinet.net
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
base/7/x86_64/filelists_db | 7.1 MB 00:00:01
https://mirrors.tuna.tsinghua.edu.cn/epel/7/x86_64/repodata/7d047e4875dc539bff4e1d0c80773d751fae85c440394eb0a5f3ab65ae55cc1a-filelists.sqlite.bz2: [Errno 14] HTTPS Error 404 - Not Found
Trying other mirror.
To address this issue please refer to the below knowledge base article
https://access.redhat.com/articles/1320623
If above article doesn't help to resolve this issue please create a bug on https://bugs.centos.org/
epel/x86_64/filelists_db | 11 MB 00:01:31
extras/7/x86_64/filelists_db | 236 kB 00:00:00
updates/7/x86_64/filelists_db | 3.4 MB 00:00:00
1:bash-completion-extras-2.1-11.el7.noarch : Additional programmable completions for
: Bash
Repo : epel
Matched from:
Filename : /usr/share/bash-completion/completions/nslookup
32:bind-utils-9.9.4-50.el7.x86_64 : Utilities for querying DNS name servers
Repo : Centos7
Matched from:
Filename : /usr/bin/nslookup
32:bind-utils-9.9.4-72.el7.x86_64 : Utilities for querying DNS name servers
Repo : Centos7
Matched from:
Filename : /usr/bin/nslookup
32:bind-utils-9.9.4-72.el7.x86_64 : Utilities for querying DNS name servers
Repo : base
Matched from:
Filename : /usr/bin/nslookup
32:bind-utils-9.9.4-73.el7_6.x86_64 : Utilities for querying DNS name servers
Repo : updates
Matched from:
Filename : /usr/bin/nslookup
zsh-5.0.2-28.el7.x86_64 : Powerful interactive shell
Repo : Centos7
Matched from:
Filename : /usr/share/zsh/5.0.2/functions/nslookup
zsh-5.0.2-31.el7.x86_64 : Powerful interactive shell
Repo : Centos7
Matched from:
Filename : /usr/share/zsh/5.0.2/functions/nslookup
zsh-5.0.2-31.el7.x86_64 : Powerful interactive shell
Repo : base
Matched from:
Filename : /usr/share/zsh/5.0.2/functions/nslookup
linux下提供nslookup命令的軟件就是 bind-utils
由上面的情況大家也可以看到如何查詢到命令的軟件包,就不用記住是哪個軟件包名字了。會用命令即可查詢到軟件包。
既然知道了軟件包的名字就可以使用 yum install -y bind-utils 安裝即可。