Hey guys,

first of all, dnspython is great. Thanks for this!

Of course, I also have a little problem where I need help :).

I use some code like:
msg = dns.message.make_query(fqdn, dns.rdatatype.from_text('ANY'))
try:
     q = dns.query.udp(msg, ns_server, self.timeout)
except dns.exception.DNSException:
          try:
               q = dns.query.tcp(msg, ns_server, self.timeout)
                ...

This works fine for most DNS servers and I get the expected responses.
However, while testing I noticed that e.g. querying the server
'howl.play-bow.org' for the domain 'dnspython.org' gives me an empty
Answer object.

When I do the same with:
host -t any -v dnspython.org howl.play-bow.org

host tells me the:
;; Truncated, retrying in TCP mode.

So, I changed the code above to use dns.query.tcp() and then I actually
I get the expected result. But I'd prefer to use UDP by default and
also fallback to TCP if necessary.
The question is now: is there a better way to check whether I need to
query via TCP than by checking whether q.answer is empty? I'd have
expected that dnspython raises an exception and this is why in the
except handler I have the TCP variant. But so far, no exception is
thrown instead the q.anser object is just empty.

Just to be clear, some other DNS servers with less information output
on ANY I tested work with the above code. And I also get
the expected results for dnspython.org if I query specific RR types
like MX or similar, the problem is only with the type ANY.

Am I doing something wrong?


Thanks for your time.

Regards,
Enrico

-- 
Get my GPG key from http://www.uvena.de/pub.asc

Attachment: pgpHLDibzl2BF.pgp
Description: PGP signature

_______________________________________________
dnspython-users mailing list
[email protected]
http://howl.play-bow.org/mailman/listinfo.cgi/dnspython-users

Reply via email to