1

I want to filter out Non-authoritative answer Address information if it exists so that in response I would get only "127.0.5.0" and nothing when there is nothing returned. Here is example:

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

Regards, Edijs

1
  • Do you only want to see a response if it's non-authoritative?
    – slm
    Feb 4, 2013 at 14:49

1 Answer 1

1

If I understand your question you want only answers that are authoritative? If so this isn't directly possible with a single nslookup and/or dig command (at least not to my knowledge - unless you know which nameserver is authoritative for your queried lookup).

Given this you'll have to perform 3 look ups to get an authoritative answer.

Find out who's authoritative

% 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

Find out nameserver info

% 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

Query authority for info

% 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

Let me know if this is what you're after. If not I can adjust this answer if needed.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .