getdns_service(3)
π getdns_service(3) π
okay bestie, welcome to the getdns manual, part of the getdns docs situation. this one's about looking up a service, and yes it's as cute as it sounds πΈ
β¨ NAME β¨
getdns_service, getdns_service_sync β getdns lookup of a service π¦
π LIBRARY π
DNS Resolver library (libgetdns, -lgetdns)
π SYNOPSIS π
#include <getdns.h>
getdns_return_t
getdns_service (getdns_context *context,
const char *name,
getdns_dict *extensions,
void *userarg,
getdns_transaction_t *transaction_id,
getdns_callback_t callbackfn)
getdns_return_t
getdns_service_sync (getdns_context *context,
const char *name,
getdns_dict *extensions,
getdns_dict **response)
π«Ά DESCRIPTION π«Ά
so. getdns_service (3) and getdns_service_sync are the public entry points into the getdns API library, and their whole job is retrieving the SRV information given a name. iconic behavior honestly β¨
contextβ a pointer to the previously created DNS context that's gonna be used with this DNS request. go peek atgetdns_context (3)if you need the lore πnameβ the service name to resolve πextensionsβ extensions for this request,NULLif there are no extensions.libgetdns (3)has a whole detailed description of extensions, go read it bestieuserargβ this gets returned to the callback function untouched, and it can beNULLπΈtransaction_idβ populated by the API, and used to identify the callback (for example, to hand togetdns_cancel_callback). it can beNULL, and it's set to0if the function fails πcallbackfnβ a non-NULLpointer to a callback function defined by the application, typically used to process the response. only the asynchronous signature accepts a callback function, the synchronous signature does not include a callback, no cap.libgetdns (3)has a more detailed discussion of callback functions if you wanna get deep π§responseβ agetdns_dicttype is returned inresponse, and it 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) andstatus(an int). the storage associated with this must be freed by a call togetdns_free_sync_request_memory (3)β don't forget, or that's a memory leak and we don't do that here π
π RETURN VALUES π
upon successful completion the functions return GETDNS_RETURN_GOOD π otherwise, here's the error values that can come back at you:
GETDNS_RETURN_BAD_CONTEXTβ if the context pointer is invalid, or the context has internal deficiencies πGETDNS_RETURN_BAD_DOMAIN_NAMEβ if the domain name passed to the function is invalidGETDNS_RETURN_EXTENSION_MISFORMATβ if the data type specified in one or more of the extensions does not match the specificationsGETDNS_RETURN_GENERIC_ERRORβ if some problem was encountered in the function that isn't addressed by one of the more specific return codesGETDNS_RETURN_INVALID PARAMETERβ if one or more parameters has an invalid valueGETDNS_RETURN_MEMORY_ERRORβ if unable to allocate the memory required πGETDNS_RETURN_NO_SUCH_EXTENSIONβ if one or more of the strings specified in the extensions are not valid
π the status values π
the values of status included in the response parameter are:
GETDNS_RESPSTATUS_GOODβ if at least one response was returned πGETDNS_RESPSTATUS_NO_NAMEβ if queries for the name yielded all negative responsesGETDNS_RESPSTATUS_ALL_TIMEOUTβ if all queries for the name timed out πGETDNS_RESPSTATUS_NO_SECURE_ANSWERSβ if only secure replies are accepted (per context) and at least one response was received, but no DNS responses were secure through DNSSEC π
for a more detailed explanation of the response object, see libgetdns (3) π
π EXAMPLES π
TBD π« (the docs said TBD and honestly, same)
π FILES π
/etc/hosts/etc/resolv.conf
π₯ SEE ALSO π₯
libgetdns(3), getdns_context(3), getdns_free_sync_request_memory(3), getdns_general(3), getdns_hostname(3), getdns_address(3),
bestie reminder:responsememory goes togetdns_free_sync_request_memory (3)or it just lives in your heap forever. free your girl. π«Ά
and that's the whole page! this one's from getdns 1.7.3, dated December 2015 β yeah she's vintage, and she still ate πβ¨π
π¦ where this page comes from
- alpine 3.24: getdns-doc 1.7.3-r0 Β· BSD-3-Clause
- arch rolling: getdns 1.7.3-2 Β· BSD
- epel 10: getdns-devel 1.7.3-9.el10_2 Β· BSD-3-Clause
- epel 9: getdns-devel 1.7.3-1.el9 Β· BSD-3-Clause
- fedora 43: getdns-devel 1.7.3-9.fc43 Β· BSD-3-Clause
- fedora 43: getdns-devel 1.7.3-9.fc43 Β· BSD-3-Clause
- fedora 44: getdns-devel 1.7.3-10.fc44 Β· BSD-3-Clause
- fedora 44: getdns-devel 1.7.3-10.fc44 Β· BSD-3-Clause
- nixpkgs unstable: getdns 1.7.3
- ubuntu resolute: libgetdns-dev 1.7.3-3 Β· BSD-3-Clause
- ubuntu stonking: libgetdns-dev 1.7.3-5build1 Β· BSD-3-Clause
- Copyright (c) 2013, NLNet Labs, Verisign, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms