Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating to dnspython 2.2.1 and patching #40 #41

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion fierce/fierce.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@
import http.client
import ipaddress
import itertools
from logging import warning
import multiprocessing
import os
import pprint
import random
import socket
import sys
import time
import warnings

import dns.exception
import dns.name
Expand Down Expand Up @@ -110,7 +112,7 @@ def concatenate_subdomains(domain, subdomains):

def query(resolver, domain, record_type='A', tcp=False):
try:
resp = resolver.query(domain, record_type, raise_on_no_answer=False, tcp=tcp)
resp = resolver.resolve(qname=domain, rdtype=record_type, raise_on_no_answer=False, tcp=True)
if resp.response.answer:
return resp

Expand Down Expand Up @@ -321,6 +323,9 @@ def fierce(**kwargs):
master = query(resolver, soa_mname, record_type='A', tcp=kwargs["tcp"])
master_address = master[0].address
print("SOA: {} ({})".format(soa_mname, master_address))
if master_address == "127.0.0.1":
warning("Master address is localhost, switching to provided resolver (%s) instead" % resolver.nameservers[0])
master_address = resolver.nameservers[0]
else:
print("SOA: failure")
fatal("Failed to lookup NS/SOA, Domain does not exist")
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
dnspython==1.16.0
dnspython==2.2.1