nslookup 仅过滤 n非权威答案

nslookup 仅过滤 n非权威答案

如果存在非权威答案地址信息,我想将其过滤掉,以便在响应中我只会得到“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

问候,Edijs

答案1

如果我理解你的问题,你只想要权威的答案?如果是这样,这不可能直接用一个nslookupand/ordig命令实现(至少据我所知 - 除非你知道哪个名称服务器对于你查询的查找具有权威性)。

鉴于此,您必须执行 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

请告诉我这是否是您想要的。如果不是,我可以根据需要调整此答案。

相关内容