I have pydns-2.3.4 and I noticed some DNS failures when using an SPF mail filter.
I debugged the problem and found out that this instruction:
print DNS.DnsRequest("imsavscan.netvigator.com", qtype="A", server=['188.8.131.52'], protocol='tcp', timeout=300).req().answers
throws DNS.Base.DNSError: EOF, and occasionally DNS.Base.DNSError: no working nameservers found
and occasionally (seldom) even works.
It always seems to work when I step through it in debug.