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
DNSError when providing nameservers to DNSResolver #15
Comments
I added the following test in pycares: saghul/pycares@9689d86 It passes everywhere except on PyPy (for other reasons). So I guess it's the underlying c-ares library. Can you try to install or compile adig (included with c-ares, it's like dig but based on c-ares) and give it a try? Or try another nameserver just in case too? |
Thanks for your reply @saghul. Hmm, when I run this: import asyncio
import aiodns
loop = asyncio.get_event_loop()
resolver = aiodns.DNSResolver(loop=loop, nameservers=['8.8.8.8'])
f = resolver.query('test.de', 'NS')
result = loop.run_until_complete(f)
print(result) I get a result: [ares_query_ns_result(host='dns3.iwelt-ag.de', ttl=None), ares_query_ns_result(host='dns2.iwelt-ag.net', ttl=None), ares_query_ns_result(host='dns.iwelt-ag.net', ttl=None) These are the packets:
Though when I try any of these servers (from the
But what
And using
Also I tried some other tlds (com & nl), and those are not working either. Nasty. I can't seem to find anything about |
Hum, I really don't know what's going on :-( I can only speculate it's somewhere deep down c-ares, since using a different nameserver works... |
@ioc32 hey mate, does any of this (the DNS traces) make any sense to you? |
@saghul @maartendraijer I do not currently have a virtualenv where I can test this, but what you're experiencing may be related to the underlying subtleties in the DNS queries you are firing and how strict the library backend is when parsing them. Let me elaborate: DNS is an extremely lenient protocol and will allow for "some" answers being sent back as responses to queries that are not strictly correct. In this case, you get the expected answers from aiodns/pycares when you pass a caching resolver to the DNSResolver class, but you do not when you pass an authoritative name-server (all name-servers in the additional section are of course authoritative). I don't know how DNSResolver treats DNS responses with the RA (Recursion Available) bit set to zero. Please have a look at the differences in the DNS flags and responses here [1], hopefully the examples there are more helpful than my explanation :) [1] ; <<>> DiG 9.8.3-P1 <<>> @81.91.164.5 +norec test.de ns ;; QUESTION SECTION: ;; AUTHORITY SECTION: ;; ADDITIONAL SECTION: ;; Query time: 29 msec iortiz@rigel:~ ; <<>> DiG 9.8.3-P1 <<>> @81.91.164.5 test.de ns ;; QUESTION SECTION: ;; AUTHORITY SECTION: ;; ADDITIONAL SECTION: ;; Query time: 30 msec iortiz@rigel:~ ; <<>> DiG 9.8.3-P1 <<>> @8.8.8.8 test.de ns ;; QUESTION SECTION: ;; ANSWER SECTION: ;; Query time: 29 msec |
update: seems to be resolved |
could you try this on debian stretch with python3.6? I tried both the pycares wheel and installing from source. After building c-ares from source@master, here are the results comparing dig with adig
|
Closing since there is not much we can do on our side. c-ares is doing the heavy lifting. That said, pycates 3.0.0 (currently in beta) bumped c-ares to version 1.15.0, maybe some bug related to this got fixed. |
Hi!
Question. I'm trying to fetch the name servers of a specific domain name. This works when I don't provide nameservers to the
DNSResolver
:This results in:
But, when I do this:
This is the result:
Though when I capture the packets I see that I'm getting the results back from the name server:
Am I missing something, or is this a bug somewhere in
aiodns
orpycares
?The text was updated successfully, but these errors were encountered: