The getdns_general(3) and getdns_general_sync functions provide public entry points into the getdns API library to retrieve any valid responses to a query from the DNS.
Specifies the RRtype for the query; the RRtype numbers are listed in the IANA registry. For example, to get the NS records, request_type would be 2. The API also has defined macros for most of the RRtypes by name; the definition names all start with "GETDNS_RRTYPE_". For example, to get the NS records, you can also set the request_type to GETDNS_RRTYPE_NS.
.HP3
.Iextensions
extensions for this request, NULL if no extensions, see libgetnds (3) for a detailed description of extensions
pointer to a callback function defined by the application, typically used to process the response, may not be NULL. Only the asynchronous signature accepts a callback function, the synchronous signature does not include a callback.
A getdns_dict type is returned in response and always contains at least three names: replies_full (a list containing the DNS response as binary data), replies_tree (a list containing the parsed DNS response data) and status (an int). The storage associated with this must be freed by a call to getdns_free_sync_request_memory (3).
.HP
.SH"RETURN VALUES"
Upon successful completion the functions return
.BGETDNS_RETURN_GOOD
, otherwise the following error values are returned:
.LP
.BGETDNS_RETURN_BAD_CONTEXT
if the context pointer is invalid
.LP
.BGETDNS_RETURN_BAD_DOMAIN_NAME
if the domain name passed to the function is invalid
.LP
.BGETDNS_RETURN_EXTENSION_MISFORMAT
if the data type specified in one or more of the extensions does not match the specifications
.LP
.BGETDNS_RETURN_NO_SUCH_EXTENSION
if one or more of the strings specified in the extensions are not valid
Queries for the name yielded all negative responses
.LP
.BGETDNS_RESPSTATUS_ALL_TIMEOUT
All queries for the name timed out
.LP
.BGETDNS_RESPSTATUS_NO_SECURE_ANSWERS
only secure replies accepted (per context), at least one response was received but no DNS responses were secure through DNSSEC
.LP
For a more detailed explanation of the response object see
.Ilibgetdns
(3)
.SHREQUESTTYPES
This is a list of the most common request types, a full list of request types in more detail is avalabile at http://www.iana.org/assignments/dns-parameters/dns-parameters.xml