Windows之nslookup用法
nslookup交互式用法
一般我们用nslookup命令在非交互式模式下来解析某个域名的IP地址是什么,如果需要用指定的DNS服务器去解析它需要用交互式的方式进行测试,如下:
C:\Users\Administrator>nslookup
默认服务器: UnKnown
Address: 127.0.0.1
> server 8.8.8.8 #server DNS服务器地址
默认服务器: [8.8.8.8]
Address: 8.8.8.8
> set q=A #set配置解析的模式为A记录
> www.baidu.com #要解析的域名是什么
服务器: [8.8.8.8]
Address: 8.8.8.8
非权威应答:
名称: www.a.shifen.com
Addresses: 110.242.68.3
110.242.68.4
Aliases: www.baidu.com
C:\Users\Administrator>nslookup
默认服务器: UnKnown
Address: 192.168.1.1
> server 192.168.1.104
默认服务器: [192.168.1.104]
Address: 192.168.1.104
> myzdl.xin
服务器: [192.168.1.104]
Address: 192.168.1.104
名称: myzdl.xin
Address: 127.0.0.1
> www.myzdl.xin
服务器: [192.168.1.104]
Address: 192.168.1.104
名称: www.myzdl.xin
Address: 172.16.1.10
> set type=ns
> myzdl.xin
服务器: [192.168.1.104]
Address: 192.168.1.104
myzdl.xin nameserver = myzdl.xin
myzdl.xin nameserver = dns2.myzdl.xin
myzdl.xin nameserver = dns1.myzdl.xin
myzdl.xin internet address = 127.0.0.1
dns1.myzdl.xin internet address = 192.168.1.104
dns2.myzdl.xin internet address = 192.168.1.105
> set type=mx
> myzdl.xin
服务器: [192.168.1.104]
Address: 192.168.1.104
myzdl.xin MX preference = 10, mail exchanger = mail1.myzdl.xin
myzdl.xin MX preference = 20, mail exchanger = mail2.myzdl.xin
myzdl.xin nameserver = dns2.myzdl.xin
myzdl.xin nameserver = dns1.myzdl.xin
myzdl.xin nameserver = myzdl.xin
mail1.myzdl.xin internet address = 192.168.2.100
mail2.myzdl.xin internet address = 192.168.2.200
myzdl.xin internet address = 127.0.0.1
dns1.myzdl.xin internet address = 192.168.1.104
dns2.myzdl.xin internet address = 192.168.1.105
> set type=a
> web.myzdl.xin
服务器: [192.168.1.104]
Address: 192.168.1.104
名称: www.myzdl.xin
Address: 172.16.1.10
Aliases: web.myzdl.xin
> www.qq.com
服务器: [192.168.1.104]
Address: 192.168.1.104
非权威应答:
名称: public.sparta.mig.tencent-cloud.net
Addresses: 14.18.175.154
113.96.232.215
Aliases: www.qq.com
> www.sina.com
服务器: [192.168.1.104]
Address: 192.168.1.104
非权威应答:
名称: spool.grid.sinaedge.com
Address: 117.21.216.80
Aliases: www.sina.com
us.sina.com.cn
>