linux 最小安装没有nslookup命令,这时我们需要安装软件包
我的系统是Centos 8.2 默认yum 安装好的
一、使用yum 来安装nslookup
1、使用 yum whatprovides */nslookup 命令来查看我们需要安装什么软件包
[root@localhost ~]# yum provides */nslookup Last metadata expiration check: 0:10:47 ago on Tue 29 Sep 2020 11:37:05 PM CST. bash-completion-1:2.7-5.el8.noarch : Programmable completion for Bash Repo : BaseOS Matched from: Filename : /usr/share/bash-completion/completions/nslookup bind-utils-32:9.11.13-6.el8_2.1.x86_64 : Utilities for querying DNS name servers Repo : AppStream Matched from: Filename : /usr/bin/nslookup zsh-5.5.1-6.el8_1.2.x86_64 : Powerful interactive shell Repo : @System Matched from: Filename : /usr/share/zsh/5.5.1/functions/nslookup zsh-5.5.1-6.el8_1.2.x86_64 : Powerful interactive shell Repo : BaseOS Matched from: Filename : /usr/share/zsh/5.5.1/functions/nslookup
[root@localhost ~]# yum whatprovides nslookup Last metadata expiration check: 1:11:25 ago on Tue 29 Sep 2020 11:49:41 PM CST. bind-utils-32:9.11.13-6.el8_2.1.x86_64 : Utilities for querying DNS name servers Repo : AppStream Matched from: Filename : /usr/bin/nslookup
2、确认了要安装那个软件包,使用yum install bind-utils 来安装
[root@localhost ~]# yum install bind-utils Last metadata expiration check: 1:18:25 ago on Tue 29 Sep 2020 11:49:41 PM CST. Dependencies resolved. =============================================================================================== Package Architecture Version Repository Size =============================================================================================== Installing: bind-utils x86_64 32:9.11.13-6.el8_2.1 AppStream 443 k Installing dependencies: bind-libs x86_64 32:9.11.13-6.el8_2.1 AppStream 172 k bind-libs-lite x86_64 32:9.11.13-6.el8_2.1 AppStream 1.2 M bind-license noarch 32:9.11.13-6.el8_2.1 AppStream 101 k python3-bind noarch 32:9.11.13-6.el8_2.1 AppStream 148 k Transaction Summary =============================================================================================== Install 5 Packages Total download size: 2.0 M Installed size: 4.7 M Is this ok [y/N]: y Downloading Packages: (1/5): bind-license-9.11.13-6.el8_2.1.noarch.rpm 409 kB/s | 101 kB 00:00 (2/5): bind-libs-9.11.13-6.el8_2.1.x86_64.rpm 409 kB/s | 172 kB 00:00 (3/5): python3-bind-9.11.13-6.el8_2.1.noarch.rpm 1.4 MB/s | 148 kB 00:00 (4/5): bind-utils-9.11.13-6.el8_2.1.x86_64.rpm 1.9 MB/s | 443 kB 00:00 (5/5): bind-libs-lite-9.11.13-6.el8_2.1.x86_64.rpm 1.7 MB/s | 1.2 MB 00:00 ----------------------------------------------------------------------------------------------- Total 1.0 MB/s | 2.0 MB 00:01 Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Installing : bind-license-32:9.11.13-6.el8_2.1.noarch 1/5 Installing : bind-libs-lite-32:9.11.13-6.el8_2.1.x86_64 2/5 Installing : bind-libs-32:9.11.13-6.el8_2.1.x86_64 3/5 Installing : python3-bind-32:9.11.13-6.el8_2.1.noarch 4/5 Installing : bind-utils-32:9.11.13-6.el8_2.1.x86_64 5/5 Running scriptlet: bind-utils-32:9.11.13-6.el8_2.1.x86_64 5/5 Verifying : bind-libs-32:9.11.13-6.el8_2.1.x86_64 1/5 Verifying : bind-libs-lite-32:9.11.13-6.el8_2.1.x86_64 2/5 Verifying : bind-license-32:9.11.13-6.el8_2.1.noarch 3/5 Verifying : bind-utils-32:9.11.13-6.el8_2.1.x86_64 4/5 Verifying : python3-bind-32:9.11.13-6.el8_2.1.noarch 5/5 Installed: bind-libs-32:9.11.13-6.el8_2.1.x86_64 bind-libs-lite-32:9.11.13-6.el8_2.1.x86_64 bind-license-32:9.11.13-6.el8_2.1.noarch bind-utils-32:9.11.13-6.el8_2.1.x86_64 python3-bind-32:9.11.13-6.el8_2.1.noarch Complete! [root@localhost ~]#
3、安装完成就可以使用NSLOOKUP
> ^C[root@localhost ~]# nslookup > www.baidu.com Server: 192.168.235.2 Address: 192.168.235.2#53 Non-authoritative answer: www.baidu.com canonical name = www.a.shifen.com. Name: www.a.shifen.com Address: 39.156.66.14 Name: www.a.shifen.com Address: 39.156.66.18 >
4、如果你没有安装yum 可以挂在linux 镜像,找到Packages 目录,找到相对应的软件包安装包即可
[root@localhost Packages]# rpm -vih bind-utils-9.11.13-3.el8.x86_64.rpm
继续阅读
评论