chg: [lib] add the port option for recursive resolver outside the standard TCP/UDP 53 port

This commit is contained in:
Alexandre Dulaunoy 2022-07-29 10:17:25 +02:00
parent 9c811e48c8
commit f933e531cb
Signed by: adulau
GPG key ID: 09E2CD4944E6CBCD

View file

@ -34,10 +34,11 @@ class Extract:
from a rawtext stream. When call, the rawtext parameter is a string from a rawtext stream. When call, the rawtext parameter is a string
containing the raw data to be process.""" containing the raw data to be process."""
def __init__(self, rawtext=None, nameservers=['8.8.8.8']): def __init__(self, rawtext=None, nameservers=['8.8.8.8'], port= 53):
self.rawtext = rawtext self.rawtext = rawtext
self.presolver = dns.resolver.Resolver() self.presolver = dns.resolver.Resolver()
self.presolver.nameservers = nameservers self.presolver.nameservers = nameservers
self.presolver.port = 53
self.presolver.lifetime = 1.0 self.presolver.lifetime = 1.0
self.bgprankingserver = 'pdns.circl.lu' self.bgprankingserver = 'pdns.circl.lu'
self.vdomain = [] self.vdomain = []