[Twisted-Python] Twisted.Names assistance with auth and additional sections

Sean Leach kickdaddy at gmail.com
Tue Mar 20 15:27:26 MDT 2007


Hey all,

I have a client I have written using twisted.names that will send a
DNS request.  Here is the gist of the relevant code:

    (tfp, tfile) = tempfile.mkstemp()
    os.write(tfp, 'nameserver %s' % ip)
    os.close(tfp)
    resolver = client.createResolver(resolvconf=tfile)
    deferred = resolver.lookupAddress(somevalue)
    deferred.addCallback(resultHandler)

hacky way to set the IP, but I am having issues with passing in the
"servers" list I don't want to troubleshoot until I figure out this
problem.

Anyways, as you can see, this code calls the lookupAddress method for
the name I want.  The problem I am having is it is only returning the
answer section of the response.  I need the additional and authority
sections as well (and I know for sure those sections exist in the
response).  I have looked at the docs and the code, and I don't know
what I am missing.  I am sure it's something silly, but I am missing
it right now.

So long question short, what do I need to change in my code so I can
get the additional sections and authority sections in the response so
I can get to those values?

Thanks,
Sean




More information about the Twisted-Python mailing list