You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
685 B
26 lines
685 B
from .module import Module
|
|
from client.subdomain.oneforall.common import utils
|
|
|
|
|
|
class Lookup(Module):
|
|
"""
|
|
DNS查询基类
|
|
"""
|
|
def __init__(self):
|
|
Module.__init__(self)
|
|
|
|
def query(self):
|
|
"""
|
|
查询域名的TXT记录
|
|
:return: 查询结果
|
|
"""
|
|
answer = utils.dns_query(self.domain, self.type)
|
|
if answer is None:
|
|
return None
|
|
for item in answer:
|
|
record = item.to_text()
|
|
subdomains = utils.match_subdomain(self.domain, record)
|
|
self.subdomains = self.subdomains.union(subdomains)
|
|
self.gen_record(subdomains, record)
|
|
return self.subdomains
|