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

Fix use of incorrect method when resolving CNAMES #54

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jeteon
Copy link

@jeteon jeteon commented Feb 7, 2017

When checking CNAME records, the code calls:

self.resolver.query(cname_host, "A", total_rechecks)

Which results in an integer argument being given for the name_server argument in the resolver.query method which has the signature:

def query(self, hostname, query_type = 'ANY', name_server = False, use_tcp = False):

And causes an error to be raised in dnslib:

File "dnslib/dns.py", line 375, in send
    sock.sendto(self.pack(),(dest,port))
TypeError: coercing to Unicode: need string or buffer, int found

It seems from the call signature intended to be recursive call to the check method itself with a preservation of the retry count so that's what I put in.

When checking `CNAME` records, the code calls:
```
self.resolver.query(cname_host, "A", total_rechecks)
```

Which results in an integer argument being given for the `name_server` argument in the `resolver.query` method which has the signature:
```
def query(self, hostname, query_type = 'ANY', name_server = False, use_tcp = False):
```
And causes an error to be raised in `dnslib`:
```
 File "dnslib/dns.py", line 375, in send
    sock.sendto(self.pack(),(dest,port))
TypeError: coercing to Unicode: need string or buffer, int found
```

It seems from the call signature intended to be recursive call to the `check` method itself with a preservation of the retry count so that's what I put in.
@jeteon jeteon changed the title Fix use of incorrect method Fix use of incorrect method when resolving CNAMES Feb 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant