Implement Reverse DNS Annotation #38
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds:
zannotateExample
Notes/Caveats
I noted 2 implementation choices to make here
Some IPs like
12.8.130.35have CNAMEs returned.qname,dns record type, andanswer.net.LookupAddrdoes, and I figure if people wanted to study the DNS ecosystem, they'd use the more verbose output from ZDNS.$ dig -x 12.8.130.35 ... ;; ANSWER SECTION: 35.130.8.12.in-addr.arpa. 83000 IN CNAME 35.0/25.130.8.12.in-addr.arpa. 35.0/25.130.8.12.in-addr.arpa. 86400 IN PTR pm2-26.btconline.net.- **Opt 1 - Quiet errors - We return an empty list for errors
PTRrecord. I ended up going with Option 1 even if that means that some sort of network issue will just result in a bunch ofnullentries BUT I do log errors at aDEBUGlevel for observability.Performance
As a naive comparison, I replaced the annotation with ZDNS with
net.LookupAddr, Go's std. lib. function for reverse PTR lookups. On a set of 10k IPs and a VM with plenty of compute/network bandwidth, ZDNS was 5x faster at 30 sec. for all lookups vs. 2 min, 30 sec.Related Issues
Resolves #4