如何在CentOS 6.3上安装nslookup
nslookup是bind-utils软件包的一部分。请注意,host、dig和nslookup也是bind工具的一部分。如果没有安装bind-utils包,当你尝试nslookup任何域时,你会得到以下错误。
[root@centos63 ~]# nslookup -bash: nslookup: command not found.3
要在CentOS 6.3中安装nslookup,只需运行这个命令。
[root@centos63 ~]# yum install bind-utils -y Loaded plugins: fastestmirror, presto Loading mirror speeds from cached hostfile * base: ossm.utm.my * extras: ossm.utm.my * updates: ossm.utm.my CentOS6.3-Repository | 4.0 kB 00:00 ... Setting up Install Process Resolving Dependencies --> Running transaction check ---> Package bind-utils.i686 32:9.8.2-0.10.rc1.el6_3.2 will be installed --> Processing Dependency: bind-libs = 32:9.8.2-0.10.rc1.el6_3.2 for package: 32:bind-utils-9.8.2-0.10.rc1.el6_3.2.i686 --> Processing Dependency: liblwres.so.80 for package: 32:bind-utils-9.8.2-0.10.rc1.el6_3.2.i686 --> Processing Dependency: libisccfg.so.82 for package: 32:bind-utils-9.8.2-0.10.rc1.el6_3.2.i686 --> Processing Dependency: libisccc.so.80 for package: 32:bind-utils-9.8.2-0.10.rc1.el6_3.2.i686 --> Processing Dependency: libisc.so.83 for package: 32:bind-utils-9.8.2-0.10.rc1.el6_3.2.i686 --> Processing Dependency: libdns.so.81 for package: 32:bind-utils-9.8.2-0.10.rc1.el6_3.2.i686 --> Processing Dependency: libbind9.so.80 for package: 32:bind-utils-9.8.2-0.10.rc1.el6_3.2.i686 --> Running transaction check ---> Package bind-libs.i686 32:9.8.2-0.10.rc1.el6_3.2 will be installed --> Finished Dependency Resolution Dependencies Resolved ==================================================================================================== Package Arch Version Repository Size ==================================================================================================== Installing: bind-utils i686 32:9.8.2-0.10.rc1.el6_3.2 updates 180 k Installing for dependencies: bind-libs i686 32:9.8.2-0.10.rc1.el6_3.2 updates 882 k Transaction Summary ==================================================================================================== Install 2 Package(s) Total download size: 1.0 M Installed size: 2.7 M Downloading Packages: Setting up and reading Presto delta metadata Processing delta metadata Package(s) data still to download: 1.0 M (1/2): bind-libs-9.8.2-0.10.rc1.el6_3.2.i686.rpm | 882 kB 00:09 (2/2): bind-utils-9.8.2-0.10.rc1.el6_3.2.i686.rpm | 180 kB 00:01 ---------------------------------------------------------------------------------------------------- Total 97 kB/s | 1.0 MB 00:10 Running rpm_check_debug Running Transaction Test Transaction Test Succeeded Running Transaction Installing : 32:bind-libs-9.8.2-0.10.rc1.el6_3.2.i686 1/2 Installing : 32:bind-utils-9.8.2-0.10.rc1.el6_3.2.i686 2/2 Verifying : 32:bind-utils-9.8.2-0.10.rc1.el6_3.2.i686 1/2 Verifying : 32:bind-libs-9.8.2-0.10.rc1.el6_3.2.i686 2/2 Installed: bind-utils.i686 32:9.8.2-0.10.rc1.el6_3.2 Dependency Installed: bind-libs.i686 32:9.8.2-0.10.rc1.el6_3.2 Complete!
现在你可以开始使用nslookup。
[root@centos63 ~]# nslookup > www.google.com Server: 8.8.8.8 Address: 8.8.8.8#53 Non-authoritative answer: www.google.com canonical name = www.l.google.com. Name: www.l.google.com Address: 209.85.175.147 Name: www.l.google.com Address: 209.85.175.103 Name: www.l.google.com Address: 209.85.175.104 Name: www.l.google.com Address: 209.85.175.105 Name: www.l.google.com Address: 209.85.175.106 Name: www.l.google.com Address: 209.85.175.99