nslookup工具

输入 nslookup 加上域名后回车,会直接对域名进行查询:

sbxfc$ nslookup sbxfc.ok2.site
Server:     223.5.5.5
Address:    223.5.5.5#53

Non-authoritative answer:
Name:   sbxfc.ok2.site
Address: 35.164.14.188

直接输入 nslookup 后回车,会进入交互模式,键入D(control-D) 或 exit 退出。

sbxfc$ nslookup
> ^D

默认情况下 nslookup 会查询A(地址记录)

sbxfc$ nslookup
> sbxfc.ok2.site
Server:     114.114.114.114
Address:    114.114.114.114#53

Non-authoritative answer:
Name:   sbxfc.ok2.site
Address: 35.164.14.188
> ^D

如果输入的是IP地址(且nslookup的查询类型是A或PTR),那么nslookup就会将地址反转,在尾部添加上in-add.arpa,然后查找PTR记录:(我用的是一台亚马逊ec2主机)

sbxfc$ nslookup
> 35.164.14.188
Server:     114.114.114.114
Address:    114.114.114.114#53

Non-authoritative answer:
188.14.164.35.in-addr.arpa  name = ec2-35-164-14-188.us-west-2.compute.amazonaws.com.

Authoritative answers can be found from:

查询name server(NS):

$ nslookup
> set type=NS
> sina.com.cn
Server:     114.114.114.114
Address:    114.114.114.114#53

Non-authoritative answer:
sina.com.cn nameserver = ns4.sina.com.cn.
sina.com.cn nameserver = ns2.sina.com.cn.
sina.com.cn nameserver = ns1.sina.com.cn.
sina.com.cn nameserver = ns3.sina.com.cn.

Authoritative answers can be found from:
>exit

指定客户度解析服务器来查询域名的IP:

$ nslookup - 8.8.8.8
> 163.com
Server:     8.8.8.8
Address:    8.8.8.8#53

Non-authoritative answer:
Name:   163.com
Address: 123.58.180.8
Name:   163.com
Address: 123.58.180.7
>exit

当然也可以这写:

$ nslookup 163.com 8.8.8.8

查看邮件服务器:

$ nslookup
> set type=MX
> 163.com
Server:     114.114.114.114
Address:    114.114.114.114#53

Non-authoritative answer:
163.com mail exchanger = 10 163mx01.mxmail.netease.com.
163.com mail exchanger = 10 163mx02.mxmail.netease.com.
163.com mail exchanger = 10 163mx03.mxmail.netease.com.
163.com mail exchanger = 50 163mx00.mxmail.netease.com.

Authoritative answers can be found from:
> set type=A
> 163mx01.mxmail.netease.com
Server:     114.114.114.114
Address:    114.114.114.114#53

Non-authoritative answer:
Name:   163mx01.mxmail.netease.com
Address: 220.181.14.138
Name:   163mx01.mxmail.netease.com
Address: 220.181.14.137
Name:   163mx01.mxmail.netease.com
Address: 220.181.14.140
Name:   163mx01.mxmail.netease.com
Address: 220.181.14.142
Name:   163mx01.mxmail.netease.com
Address: 220.181.14.141
Name:   163mx01.mxmail.netease.com
Address: 220.181.14.143
Name:   163mx01.mxmail.netease.com
Address: 220.181.14.139
Name:   163mx01.mxmail.netease.com
Address: 220.181.14.135
Name:   163mx01.mxmail.netease.com
Address: 220.181.14.136

查看顶级域信息

$ nslookup - 8.8.8.8
> set type=ns
> me.
Server:     8.8.8.8
Address:    8.8.8.8#53

Non-authoritative answer:
me  nameserver = a0.cctld.afilias-nst.info.
me  nameserver = a2.me.afilias-nst.info.
me  nameserver = b0.cctld.afilias-nst.org.
me  nameserver = b2.me.afilias-nst.org.
me  nameserver = c0.cctld.afilias-nst.info.
me  nameserver = d0.cctld.afilias-nst.org.
me  nameserver = ns.nic.me.
me  nameserver = ns2.nic.me.

Authoritative answers can be found from:
> 

Comments