Skip to content

Commit

Permalink
Look up PTR for in-addr.arpa record instead
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyle Maxwell committed Apr 3, 2015
1 parent ba6a6c8 commit ed398a6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion winnower.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import json
import pygeoip
import re
import sys

from netaddr import IPAddress, IPRange, IPSet
from sortedcontainers import SortedDict
Expand Down Expand Up @@ -67,7 +68,8 @@ def enrich_IPv4(address, dnsdb=None, hostname=None):
as_num, as_name = org_by_addr(address)
country = geo_data.country_code_by_addr('%s' % address)
if dnsdb:
rhost = maxhits(dnsdb.query_rdata_ip('%s' % address))
inaddr = address.reverse_dns

This comment has been minimized.

Copy link
@alexcpsec

alexcpsec Apr 3, 2015

Member

Hahaha! This is super useful! :)

This comment has been minimized.

Copy link
@krmaxwell

krmaxwell Apr 3, 2015

Member

not done but that should be helpful :D

rhost = maxhits(dnsdb.query_rrset('%s' % inaddr))
else:
rhost = None
return (as_num, as_name, country, hostname, rhost)
Expand Down

0 comments on commit ed398a6

Please sign in to comment.