Nslookup

nslookup 僅過濾 nNon-authoritative answer 答案

  • February 4, 2013

我想過濾掉非權威答案地址資訊(如果存在),以便在沒有返回任何內容時我只會得到“127.0.5.0”作為響應。這是範例:

user@machine:~$ nslookup honeypotkey.71.78.249.66.dnsbl.httpbl.org
Server:         109.74.192.20
Address:        109.74.192.20#53
Non-authoritative answer:
Name:   ryjonpjinfae.71.78.249.66.dnsbl.httpbl.org
Address: 127.0.5.0

問候,埃迪

如果我理解您的問題,您只需要權威的答案嗎?如果是這樣,這不可能直接使用單個nslookup和/或dig命令(至少據我所知不是 - 除非您知道哪個名稱伺服器對您的查詢查找具有權威性)。

鑑於此,您必須執行 3 次查找才能獲得權威答案。

找出誰是權威

% nslookup -type=soa honeypotkey.71.78.249.66.dnsbl.httpbl.org.
Server: 192.168.1.5
Address:    192.168.1.5#53

Non-authoritative answer:
*** Can't find honeypotkey.71.78.249.66.dnsbl.httpbl.org.: No answer

Authoritative answers can be found from:
dnsbl.httpbl.org
   origin = dnsbl.httpbl.org
   mail addr = dnsadmin.projecthoneypot.org
   serial = 1359954681
   refresh = 7200
   retry = 7200
   expire = 604800
   minimum = 3600

找出名稱伺服器資訊

% nslookup -type=ns dnsbl.httpbl.org
Server: 192.168.1.5
Address:    192.168.1.5#53

Non-authoritative answer:
dnsbl.httpbl.org    nameserver = ns3.httpbl.org.
dnsbl.httpbl.org    nameserver = ns2.httpbl.org.
dnsbl.httpbl.org    nameserver = ns1.httpbl.org.

Authoritative answers can be found from:
ns3.httpbl.org  internet address = 81.17.242.92
ns2.httpbl.org  internet address = 66.114.104.118
ns1.httpbl.org  internet address = 209.124.55.46

資訊查詢權限

% nslookup honeypotkey.71.78.249.66.dnsbl.httpbl.org. ns1.httpbl.org
Server:     ns1.httpbl.org
Address:    209.124.55.46#53

Name:   honeypotkey.71.78.249.66.dnsbl.httpbl.org
Address: 127.0.5.0

讓我知道這是否是你所追求的。如果沒有,我可以根據需要調整這個答案。

引用自:https://serverfault.com/questions/475211