Using differnt nameserver..

171 views
Skip to first unread message

pittipatti

unread,
Mar 13, 2008, 12:34:45 PM3/13/08
to adns-python
Hi,

I can't find a way to initialize adns with a different dns-server.
In adnsmodule.c I saw the conditional branch for a set "configtest" to
do the adns_init_strcfg, but I'm unable to set this configtext-
parameter.

Using
s=adns.init(configtext="nameserver 1.2.3.4")
results in
TypeError: init() takes no keyword arguments

and

s=adns.init(adns.iflags.noautosys,0,"nameserver 1.2.3.4")
results in
TypeError: argument 2 must be (unspecified), not int

What's the right way to call the init-function?

Thanks in advance!

best regards
Patrick

Andy Dustman

unread,
Mar 13, 2008, 12:48:44 PM3/13/08
to adns-python
configtest isn't a keyword argument, and probably should be. The
second argument is diagfile; it should be a Python file object. Try
this:

import sys
import adns

s = adns.init(adns.iflags.noautosys, sys.stderr, "nameserver 1.2.3.4")

Let me know if this works.

On Mar 13, 11:34 am, pittipatti <patrick.scharrenb...@googlemail.com>
wrote:

Andy Dustman

unread,
Mar 13, 2008, 5:12:16 PM3/13/08
to adns-python
I've committed some code so that you can use keyword arguments on
adns.init(). Give it a try. If it works it'll be 1.2.2.

pittipatti

unread,
Mar 16, 2008, 8:04:37 AM3/16/08
to adns-python
Hi!

On Mar 13, 5:48 pm, Andy Dustman <farcep...@gmail.com> wrote:
^^^^^^^
I'm fairly new to google-code and google-groups and hadn't seen you
replied *so* quickly!! :-)
In fact I looked in my google-inbox where nothing happened and
though't: why doesn't anybody answer... ;-)

> s = adns.init(adns.iflags.noautosys, sys.stderr, "nameserver 1.2.3.4")

Yes: this works like a charm! :-)
...so does the second solution. I just compiled it. Great!! :-)

Thank you very much!!

Patrick
Reply all
Reply to author
Forward
0 new messages