[ldns-users] How to use _searchlist provided by ldns_struct_resolver?
Zbynek Michl
zbynek.michl at nic.cz
Mon Apr 19 16:58:37 UTC 2010
Hello,
I am trying to use search list, but unsuccessfully. Here is an sample:
--- CODE ---
ldns_rdf *domain = ldns_dname_new_frm_str("myhostname");
ldns_rdf *search = ldns_dname_new_frm_str("mydomain.cz");
ldns_resolver_push_searchlist(res, search);
p = ldns_resolver_search(res, domain, LDNS_RR_TYPE_A,
LDNS_RR_CLASS_IN, LDNS_RD);
--- /CODE ---
The problem is that "myhostname.mydomain.cz" will never be tried, because of
ldns_dname_new_frm_str() adds "." to the end of "myhostname" and therefore
ldns_resolver_search() will not concatenate "mydomain.cz". So how can I create
"myhostname" RDF without trailing "."? Or any other suggestion?
Cheers,
Zbynek
More information about the ldns-users
mailing list