[ldns-users] Are there send() and recv()-like interfaces in libdns?

Damião Rodrigues adamiaonr at gmail.com
Sun Jul 31 21:04:18 UTC 2016

I've built a simple command line application in C which uses libdns to make
periodic DNS queries to the authoritative name servers of multiple domains.
Ensuring the periodicity of the queries is important, following a
user-defined query_interval (in seconds).

As far as I could tell, libdns only allows for request-response calls: the
functions which start DNS queries also return the DNS response, blocking
until a response is received. Because of this, I've implemented a key part
of the application in a naive way within a while() cycle:

   1. I do a block of queries
   2. Take note of the time taken by the query block (query_time)
   3. sleep(query_interval - query_time)
   4. Go back to 1

I think this is sloppy. A better option would be to have separate
send/receive threads. This way, the periodicity of the query blocks
wouldn't be affected by the duration of the request-response cycles. But
for that I would need libdns functions with separate send()- and
recv()-like interfaces, which I couldn't find in the documentation, greps
in the source folders, nor examples.

Have I missed something? *Are there send()- and recv()-like interfaces in

Thanks in advance!

Best regards,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nlnetlabs.nl/pipermail/ldns-users/attachments/20160731/461a6452/attachment.htm>

More information about the ldns-users mailing list