這個可能你們用到最多,查詢一個域名的A記錄。html
nslookup domain [dns-server]數據庫
若是沒指定dns-server,用系統默認的dns服務器。下面是一個例子:緩存
C:\Users\jackie>nslookup www.ezloo.com 8.8.8.8
Server: google-public-dns-a.google.com
Address: 8.8.8.8服務器
Non-authoritative answer:
Name: www.ezloo.com
Address: 70.32.68.136dom
直接查詢返回的是A記錄,咱們能夠指定參數,查詢其餘記錄,好比AAAA、MX等。ide
nslookup -qt=type domain [dns-server]this
其中,type能夠是如下這些類型:google
A 地址記錄
AAAA 地址記錄
AFSDB Andrew文件系統數據庫服務器記錄
ATMA ATM地址記錄
CNAME 別名記錄
HINFO 硬件配置記錄,包括CPU、操做系統信息
ISDN 域名對應的ISDN號碼
MB 存放指定郵箱的服務器
MG 郵件組記錄
MINFO 郵件組和郵箱的信息記錄
MR 更名的郵箱記錄
MX 郵件服務器記錄
NS 名字服務器記錄
PTR 反向記錄
RP 負責人記錄
RT 路由穿透記錄
SRV TCP服務器信息記錄
TXT 域名對應的文本信息
X25 域名對應的X.25地址記錄spa
例如:操作系統
C:\Users\jackie>nslookup -qt=mx ezloo.com 8.8.8.8
Server: google-public-dns-a.google.com
Address: 8.8.8.8
Non-authoritative answer:
ezloo.com MX preference = 10, mail exchanger = aspmx.l.google.com
ezloo.com MX preference = 20, mail exchanger = alt1.aspmx.l.google.com
ezloo.com MX preference = 30, mail exchanger = alt2.aspmx.l.google.com
ezloo.com MX preference = 40, mail exchanger = aspmx2.googlemail.com
ezloo.com MX preference = 50, mail exchanger = aspmx3.googlemail.com
查詢語法:
nslookup –d [其餘參數] domain [dns-server]
只要在查詢的時候,加上-d參數,便可查詢域名的緩存。
C:\Users\jackie>nslookup -d www.ezloo.com
------------
Got answer:
HEADER:
opcode = QUERY, id = 1, rcode = NOERROR
header flags: response, want recursion, recursion avail.
questions = 1, answers = 1, authority records = 2, additional = 2
QUESTIONS:
196.134.191.60.in-addr.arpa, type = PTR, class = IN
ANSWERS:
-> 196.134.191.60.in-addr.arpa
name = tzdns1.tzptt.zj.cn
ttl = 11568 (3 hours 12 mins 48 secs)
AUTHORITY RECORDS:
-> 191.60.in-addr.arpa
nameserver = dns-noc.zjhzptt.net.cn
ttl = 11537 (3 hours 12 mins 17 secs)
-> 191.60.in-addr.arpa
nameserver = ns.zjnbptt.net.cn
ttl = 11537 (3 hours 12 mins 17 secs)
ADDITIONAL RECORDS:
-> dns-noc.zjhzptt.net.cn
internet address = 202.96.103.36
ttl = 11522 (3 hours 12 mins 2 secs)
-> ns.zjnbptt.net.cn
internet address = 202.96.104.18
ttl = 11522 (3 hours 12 mins 2 secs)
------------
Server: tzdns1.tzptt.zj.cn
Address: 60.191.134.196
------------
Got answer:
HEADER:
opcode = QUERY, id = 2, rcode = NOERROR
header flags: response, want recursion, recursion avail.
questions = 1, answers = 1, authority records = 2, additional = 0
QUESTIONS:
www.ezloo.com, type = A, class = IN
ANSWERS:
-> www.ezloo.com
internet address = 70.32.68.136
ttl = 2732 (45 mins 32 secs)
AUTHORITY RECORDS:
-> ezloo.com
nameserver = ns61.domaincontrol.com
ttl = 2365 (39 mins 25 secs)
-> ezloo.com
nameserver = ns62.domaincontrol.com
ttl = 2365 (39 mins 25 secs)
------------
Non-authoritative answer:
------------
Got answer:
HEADER:
opcode = QUERY, id = 3, rcode = NOERROR
header flags: response, want recursion, recursion avail.
questions = 1, answers = 0, authority records = 1, additional = 0
QUESTIONS:
www.ezloo.com, type = AAAA, class = IN
AUTHORITY RECORDS:
-> ezloo.com
ttl = 10800 (3 hours)
primary name server = ns61.domaincontrol.com
responsible mail addr = dns.jomax.net
serial = 2011032900
refresh = 28800 (8 hours)
retry = 7200 (2 hours)
expire = 604800 (7 days)
default TTL = 86400 (1 day)
------------ Name: www.ezloo.com Address: 70.32.68.136