[fpc-pascal] netdb and DNS queries for MX, TXT, and other resource types
Noel Duffy
noelduffy at xtra.co.nz
Wed Sep 16 06:24:27 CEST 2020
I'm in need of a library to perform DNS lookups for a range of different resource types such as MX, TXT, PTR and so on. At first I thought that netdb would do the job, but it turns out that it only supports direct A and AAA lookups. However, the code actually has the ability to query all resource types, but the module's API doesn't expose this functionality. The functions Query and BuildQuery, and the types TQueryData and TRRData are not made available to callers.
cnetdb is similar in that it exposes just a subset of what libresolv provides. There's no interface to things like res_nquery, for instance. While it's theoretically possible for me to interface directly to libresolv, in reality the API is a horrible hairball of C macros and pointers and this is not a path I want to go down.
Is it intended that netdb will be capable of querying all resource types? It appears that most of the work is already done, with the only major pieces missing the parsing of the additional resource records and the exposure of additional functions for the public API.
What other libraries are there for DNS? I'm aware of Indy and Synapse, but have used neither.
More information about the fpc-pascal
mailing list