新VPS 装了CentOS 6.x,然后默认安装时没有带nslookup 命令,不过直接用 yum install nslookup 是不行的,因为nslookup 不是独立的包。
这时候需要用yum whatprovides
来反查nslookup 在哪个安装包里。
yum whatprovides */nslookup Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: ftp.hosteurope.de * epel: ftp.cuhk.edu.hk * extras: ftp.hosteurope.de * remi: mirror.innosol.asia * remi-php70: mirror.innosol.asia * remi-safe: mirror.innosol.asia * updates: ftp.hosteurope.de zsh-4.3.11-4.el6.centos.x86_64 : A powerful interactive shell Repo : base Matched from: Filename : /usr/share/zsh/4.3.11/functions/nslookup 32:bind-utils-9.8.2-0.37.rc1.el6.x86_64 : Utilities for querying DNS name servers Repo : base Matched from: Filename : /usr/bin/nslookup |
如上所见,在zsh 和 bind-utils 两个包里都找到了nslookup 文件,显然我们现在要装的是bind-utils.
yum install bind-utils |
安装完后 dig
和host
命令也都有了