nslookup command
Function description
The nslookup command, a common network command under Windows and Linux, can be used to query or diagnose Domain Name System (DNS) information.
Linux under the Domain Name Query tool has nsloouup, dig, host
Centos7, due to the use of minimal installation, the default is not with this command, the following is the installation command demo:
[Email protected] ~]#nslookup #提示没有找到命令 -bash:nslookup: Command not found [Email protected] ~]# Yum provides */nslookup #查询nslookup使用哪个软件包 Loaded plugins: Fastestmirror Loading mirror speeds from cached hostfile * base:mirrors.neusoft.edu.cn * extras:mirrors.tuna.tsinghua.edu.cn * updates:mirrors.tuna.tsinghua.edu.cn #查询到是使用bind-utils Package :bind-utils-9.9.4-29.el7.x86_64:utilities for querying DNS name servers Source: Base Match Source: File name:/usr/bin/nslookup [[email protected] ~]# yum-y install bind-utils #安装该bind-utils Package [Email protected] ~]# nslookup > www.baidu.com server:219.141.140.10 address:219.141.140.10#53
Non-authoritative Answer: www.baidu.com canonical name = www.a.shifen.com. Name:www.a.shifen.com address:220.181.112.244 Name:www.a.shifen.com address:220.181.111.188 > |
Example
intercept the IP address of the server
[Email protected] shell]# nslookup z.cn server:114.114.114.114 address:114.114.114.114#53
Non-authoritative Answer: name:z.cn address:54.222.60.252
[Email protected] shell]# nslookup z.cn | tail-2 | head-1 | awk ' {print $} ' 54.222.60.252 [Email protected] shell]# |
This article is from the "Zhao Dongwei blog" blog, make sure to keep this source http://zhaodongwei.blog.51cto.com/4233742/1881036
Linux command ($): nslookup command-domain search tool