Closed kotyara1005 closed 5 years ago
I'm not sure I understand, aiodns gives you the same thing (module the TTL, which I think I made available in a newer pycares release) so how would you like to see the results?
I mean that aiodns or pycares strip trailing dot in domain name. It's not right, "ns1.google.com" and "ns1.google.com." are different domains.
The dot is not stripped by those libraries, it must be c-ares, I guess. You can try to compile c-ares and use their adig
tool to see what it returns exactly.
@ioc32 perhaps you can help here mate?
It looks like aiodns/c-ares simply return unqualified domain names. This is, they return a domain that it's not fully qualified or complete up to the top of the DNS namespace (the root, ".").
ns1.google.com and ns1.google.com. don't have to be the same domain necessarily, but they will indeed be the same pretty much most of the time. For most user oriented DNS tools it is safe to strip the last zone separator (".").
If the fact that labels returned by aiodns are unqualified is a problem and you need to programmatically fully qualify them in the standard DNS root, use your favorite DNS library to canonicalise them before querying them*.
If you simply need to print them (you're not parsing the string and turning it into a domain object) perhaps appending a trailing dot would suffice?
On May 6, 2017 10:44 AM, "Saúl Ibarra Corretgé" notifications@github.com wrote:
@ioc32 https://github.com/ioc32 perhaps you can help here mate?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/saghul/aiodns/issues/28#issuecomment-299625439, or mute the thread https://github.com/notifications/unsubscribe-auth/ABGQrUTe3O8u07WTXyxu1QmQmU4YfyWoks5r3DL8gaJpZM4NEUn4 .
When i use dig i obtain absolute domain names:
But aiodns gives me relative domains:
[ares_query_ns_result(host='ns3.google.com', ttl=None), ares_query_ns_result(host='ns4.google.com', ttl=None), ares_query_ns_result(host='ns2.google.com', ttl=None), ares_query_ns_result(host='ns1.google.com', ttl=None)]
Is the way to get true data exists?