nslookup

命令作用

  • 查询域名正向解析;
  • 查询域名逆向解析;
  • 查询域;

命令用法

  • 直接查询
nslookup [-option] [name | -] [server]
  • 进入nslookup交互查询
nslookup 

常用命令

  • 正向解析,获取域名对应IP地址:
nslookup www.mydomain.com
  • 逆向解析,获取IP对应域名:
nslookup 180.76.76.76
  • 获取域名下A记录:
# nslookup
> set type=A
> nsp.alibabaonline.com.
Server:     192.168.1.1
Address:    192.168.1.1#53

Non-authoritative answer:
Name:   nsp.alibabaonline.com
Address: 140.205.2.183
Name:   nsp.alibabaonline.com
Address: 140.205.71.241
  • 获取域名mx记录:
# nslookup
> set type=mx
> baidu.com
Server:     192.168.1.1
Address:    192.168.1.1#53

Non-authoritative answer:
baidu.com   mail exchanger = 10 mx.n.shifen.com.
baidu.com   mail exchanger = 20 mx50.baidu.com.
baidu.com   mail exchanger = 20 mx1.baidu.com.
baidu.com   mail exchanger = 20 jpmx.baidu.com.

Authoritative answers can be found from:
jpmx.baidu.com  internet address = 61.208.132.13
  • 获取NS记录:
# nslookup
> set type=NS
> alibaba.com
Server:     192.168.1.1
Address:    192.168.1.1#53

Non-authoritative answer:
alibaba.com nameserver = nsp.alibabaonline.com.
alibaba.com nameserver = nsp2.alibabaonline.com.
alibaba.com nameserver = ns8.alibabaonline.com.
alibaba.com nameserver = nshz.alibabaonline.com.

Authoritative answers can be found from:
ns8.alibabaonline.com   internet address = 140.205.2.185
ns8.alibabaonline.com   internet address = 140.205.71.244
nsp.alibabaonline.com   internet address = 140.205.71.241
nsp.alibabaonline.com   internet address = 140.205.2.183
nshz.alibabaonline.com  internet address = 140.205.2.186
nshz.alibabaonline.com  internet address = 140.205.71.243
nsp2.alibabaonline.com  internet address = 140.205.2.184
nsp2.alibabaonline.com  internet address = 140.205.71.242
  • 获取域名下所有记录:
# nslookup 
> set type=ANY
> baidu.com
Server:     192.168.1.1
Address:    192.168.1.1#53

Non-authoritative answer:
baidu.com   text = "v=spf1 include:spf1.baidu.com include:spf2.baidu.com include:spf3.baidu.com a mx ptr -all"
baidu.com   text = "google-site-verification=GHb98-6msqyx_qqjGl5eRatD3QTHyVB6-xQ3gJB5UwM"
baidu.com   mail exchanger = 20 mx50.baidu.com.
baidu.com   mail exchanger = 20 mx1.baidu.com.
baidu.com   mail exchanger = 20 jpmx.baidu.com.
baidu.com   mail exchanger = 10 mx.n.shifen.com.
Name:   baidu.com
Address: 220.181.57.217
Name:   baidu.com
Address: 111.13.101.208
Name:   baidu.com
Address: 123.125.114.144
baidu.com   nameserver = dns.baidu.com.
baidu.com   nameserver = ns3.baidu.com.
baidu.com   nameserver = ns4.baidu.com.
baidu.com   nameserver = ns2.baidu.com.
baidu.com   nameserver = ns7.baidu.com.

Authoritative answers can be found from:
jpmx.baidu.com  internet address = 61.208.132.13
dns.baidu.com   internet address = 202.108.22.220
ns2.baidu.com   internet address = 61.135.165.235
ns3.baidu.com   internet address = 220.181.37.10

你可能感兴趣的:(nslookup)