[ldns-users] ldns-python bug in resolver.get_addr_by_name()
Paul Wouters
paul at xelerance.com
Tue Apr 12 18:15:56 UTC 2011
The following works:
>>> import ldns
>>> resolver = ldns.ldns_resolver.new_frm_file("/etc/resolv.conf")
>>> dnn = ldns.ldns_dname("www.google.com")
>>> addr = resolver.get_addr_by_name(dnn)
>>> for rr in addr.rrs():
... print rr
...
www.l.google.com. 300 IN A 74.125.224.50
[..]
However, this does not work:
>>> addr = resolver.get_addr_by_name("www.google.com")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/site-packages/ldns.py", line 3898, in get_addr_by_name
return _ldns.ldns_get_rr_list_addr_by_name(self, name, aclass, flags)
TypeError: in method 'ldns_get_rr_list_addr_by_name', argument 2 of type 'ldns_rdf *'
>>>
The docs claim that get_addr_by_name() can do the string->dname conversion....
Paul
More information about the ldns-users
mailing list