[Twisted-Python] DNSServerBoss.getAnswers with non-authoritative requests

Hi, Since I've just guessed how the DNS Server stuff works in twisted, I may be doing something stupid. Example program: from twisted.protocols import dns from twisted.names.dns import DNSServerBoss, DNSServerFactory, SimpleDomain from twisted.internet import reactor a = DNSServerFactory() s = SimpleDomain("example.net", "192.168.8.26") a.boss.addDomain("example.net", s) a.boss.createBothFactories() a.boss.startListeningBoth(53) reactor.run() This works great for example.net: (nbm@pike) /home/nbm> host example.net 127.0.0.1 Using domain server 127.0.0.1: example.net has address 192.168.8.26 example.net mail is handled (pri=5) by example.net This works non-great for other domains - it just sits there, slowly timing out for each query made (due to 'search' or 'domain' in resolv.conf). Traceback makes it obvious where the problem is: File "/usr/local/lib/python2.2/site-packages/twisted/names/dns.py", line 370, in getAnswers name = string.split(name, '.', 1)[1] exceptions.IndexError: list index out of range Ok, that's easy, and that's the first patch (twisted.names.dns.py-noerror.patch). Once applied, it still doesn't quite work: (nbm@pike) /home/nbm> host example.org 127.0.0.1 Using domain server 127.0.0.1: There is an entry for this host, but it doesn't have a Mail Exchanger record. Second patch (no idea if this is what DNS is supposed to do) makes that more like I expect it to return: (nbm@pike) /home/nbm> host example.org 127.0.0.1 Using domain server 127.0.0.1: Host not found. I'll probably look into what is the correct response, but not soon. I'm not sure how the multiple-queries bit factors into it either. Neil -- Neil Blakey-Milner nbm@mithrandr.moria.org
participants (1)
-
Neil Blakey-Milner