ARES_DNS_RR(3)
π ARES_DNS_RR(3) β Library Functions Manual π
okay so bestie, welcome to the ares_dns_rr glow-up era β¨ this is the part of c-ares that lets you create, read, and write DNS Resource Records, and honestly? it's giving main character energy. we're talking ARES_DNS_RR(3), the manual page that's about to be your roman empire π«Ά
β¨ NAME β¨
DNS Resource Record creating, reading, and writing functions β that's the vibe. and here's the full squad, no one left behind:
ares_dns_record_rr_addares_dns_record_rr_cntares_dns_record_rr_delares_dns_record_rr_getares_dns_record_rr_get_constares_dns_rr_get_addrares_dns_rr_get_addr6ares_dns_rr_get_binares_dns_rr_get_abin_cntares_dns_rr_get_abinares_dns_rr_get_classares_dns_rr_get_nameares_dns_rr_get_optares_dns_rr_get_opt_byidares_dns_rr_get_opt_cntares_dns_rr_get_strares_dns_rr_get_ttlares_dns_rr_get_typeares_dns_rr_get_u16ares_dns_rr_get_u32ares_dns_rr_get_u8ares_dns_rr_key_tares_dns_rr_set_addrares_dns_rr_set_addr6ares_dns_rr_set_binares_dns_rr_add_abinares_dns_rr_del_abinares_dns_rr_set_optares_dns_rr_set_strares_dns_rr_set_u16ares_dns_rr_set_u32ares_dns_rr_set_u8ares_dns_section_tares_tlsa_match_tares_tlsa_selector_tares_tlsa_usage_t
πΈ SYNOPSIS πΈ
first things first, you gotta bring in the header, periodt:
#include <ares.h>
now the whole roster of function signatures, exactly as they live, no edits bestie π
size_t ares_dns_record_rr_cnt(const ares_dns_record_t *dnsrec,
ares_dns_section_t sect);
ares_status_t ares_dns_record_rr_add(ares_dns_rr_t **rr_out,
ares_dns_record_t *dnsrec,
ares_dns_section_t sect,
const char *name,
ares_dns_rec_type_t type,
ares_dns_class_t rclass,
unsigned int ttl);
ares_dns_rr_t *ares_dns_record_rr_get(ares_dns_record_t *dnsrec,
ares_dns_section_t sect,
size_t idx);
const ares_dns_rr_t *ares_dns_record_rr_get_const(const ares_dns_record_t *dnsrec,
ares_dns_section_t sect,
size_t idx);
ares_status_t ares_dns_record_rr_del(ares_dns_record_t *dnsrec,
ares_dns_section_t sect,
size_t idx);
const char *ares_dns_rr_get_name(const ares_dns_rr_t *rr);
ares_dns_rec_type_t ares_dns_rr_get_type(const ares_dns_rr_t *rr);
ares_dns_class_t ares_dns_rr_get_class(const ares_dns_rr_t *rr);
unsigned int ares_dns_rr_get_ttl(const ares_dns_rr_t *rr);
ares_status_t ares_dns_rr_set_addr(ares_dns_rr_t *dns_rr,
ares_dns_rr_key_t key,
const struct in_addr *addr);
ares_status_t ares_dns_rr_set_addr6(ares_dns_rr_t *dns_rr,
ares_dns_rr_key_t key,
const struct ares_in6_addr *addr);
ares_status_t ares_dns_rr_set_str(ares_dns_rr_t *dns_rr,
ares_dns_rr_key_t key,
const char *val);
ares_status_t ares_dns_rr_set_u8(ares_dns_rr_t *dns_rr,
ares_dns_rr_key_t key,
unsigned char val);
ares_status_t ares_dns_rr_set_u16(ares_dns_rr_t *dns_rr,
ares_dns_rr_key_t key,
unsigned short val);
ares_status_t ares_dns_rr_set_u32(ares_dns_rr_t *dns_rr,
ares_dns_rr_key_t key,
unsigned int val);
ares_status_t ares_dns_rr_set_bin(ares_dns_rr_t *dns_rr,
ares_dns_rr_key_t key,
const unsigned char *val,
size_t len);
ares_status_t ares_dns_rr_add_abin(ares_dns_rr_t *dns_rr,
ares_dns_rr_key_t key,
const unsigned char *val,
size_t len);
ares_status_t ares_dns_rr_del_abin(ares_dns_rr_t *dns_rr,
ares_dns_rr_key_t key,
size_t idx);
ares_status_t ares_dns_rr_set_opt(ares_dns_rr_t *dns_rr,
ares_dns_rr_key_t key,
unsigned short opt,
const unsigned char *val,
size_t val_len);
ares_status_t ares_dns_rr_del_opt_byid(ares_dns_rr_t *dns_rr,
ares_dns_rr_key_t key,
unsigned short opt);
const struct in_addr *ares_dns_rr_get_addr(const ares_dns_rr_t *dns_rr,
ares_dns_rr_key_t key);
const struct ares_in6_addr *ares_dns_rr_get_addr6(const ares_dns_rr_t *dns_rr,
ares_dns_rr_key_t key);
const char *ares_dns_rr_get_str(const ares_dns_rr_t *dns_rr,
ares_dns_rr_key_t key);
unsigned char ares_dns_rr_get_u8(const ares_dns_rr_t *dns_rr,
ares_dns_rr_key_t key);
unsigned short ares_dns_rr_get_u16(const ares_dns_rr_t *dns_rr,
ares_dns_rr_key_t key);
unsigned int ares_dns_rr_get_u32(const ares_dns_rr_t *dns_rr,
ares_dns_rr_key_t key);
const unsigned char *ares_dns_rr_get_bin(const ares_dns_rr_t *dns_rr,
ares_dns_rr_key_t key,
size_t *len);
size_t ares_dns_rr_get_abin_cnt(const ares_dns_rr_t *dns_rr,
ares_dns_rr_key_t key);
const unsigned char *ares_dns_rr_get_abin(const ares_dns_rr_t *dns_rr,
ares_dns_rr_key_t key, size_t idx,
size_t *len);
size_t ares_dns_rr_get_opt_cnt(const ares_dns_rr_t *dns_rr,
ares_dns_rr_key_t key);
unsigned short ares_dns_rr_get_opt(const ares_dns_rr_t *dns_rr,
ares_dns_rr_key_t key,
size_t idx,
const unsigned char **val,
size_t *val_len);
ares_bool_t ares_dns_rr_get_opt_byid(const ares_dns_rr_t *dns_rr,
ares_dns_rr_key_t key,
unsigned short opt,
const unsigned char **val,
size_t *val_len);
lowkey that's just the trailer bestie, the real lore is coming up next π stay tuned, there's more parts and we are NOT done slaying
π ENUMERATIONS π
okay bestie, this is the big one. this whole section is just β¨the loreβ¨ of every enum in this library β the section types, the record keys, and the TLSA value sets. nothing scary, it's basically a giant labeled drawer of constants. let's go π
ares_dns_section_t β DNS RR section types π
the three neighborhoods a record can live in:
ARES_SECTION_ANSWERβ the Answer section π―ARES_SECTION_AUTHORITYβ the Authority section πARES_SECTION_ADDITIONALβ the Additional Information section π
ares_dns_rr_key_t β Keys used for handling RR record parameters π
these are the keys you hand over when you're dealing with a record parameter. one per line, every single one, no skipping, we do not gatekeep here π«Ά
ARES_RR_A_ADDRβ A Record. Address. Datatype:ARES_DATATYPE_INADDRARES_RR_NS_NSDNAMEβ NS Record. Name. Datatype:ARES_DATATYPE_NAMEARES_RR_CNAME_CNAMEβ CNAME Record. CName. Datatype:ARES_DATATYPE_NAMEARES_RR_SOA_MNAMEβ SOA Record. MNAME, Primary Source of Data. Datatype:ARES_DATATYPE_NAMEARES_RR_SOA_RNAMEβ SOA Record. RNAME, Mailbox of person responsible. Datatype:ARES_DATATYPE_NAMEARES_RR_SOA_SERIALβ SOA Record. Serial, version. Datatype:ARES_DATATYPE_U32ARES_RR_SOA_REFRESHβ SOA Record. Refresh, zone refresh interval. Datatype:ARES_DATATYPE_U32ARES_RR_SOA_RETRYβ SOA Record. Retry, failed refresh retry interval. Datatype:ARES_DATATYPE_U32ARES_RR_SOA_EXPIREβ SOA Record. Expire, upper limit on authority. Datatype:ARES_DATATYPE_U32ARES_RR_SOA_MINIMUMβ SOA Record. Minimum, RR TTL. Datatype:ARES_DATATYPE_U32ARES_RR_PTR_DNAMEβ PTR Record. DNAME, pointer domain. Datatype:ARES_DATATYPE_NAMEARES_RR_HINFO_CPUβ HINFO Record. CPU. Datatype:ARES_DATATYPE_STRARES_RR_HINFO_OSβ HINFO Record. OS. Datatype:ARES_DATATYPE_STRARES_RR_MX_PREFERENCEβ MX Record. Preference. Datatype:ARES_DATATYPE_U16ARES_RR_MX_EXCHANGEβ MX Record. Exchange, domain. Datatype:ARES_DATATYPE_NAMEARES_RR_TXT_DATAβ TXT Record. Data. Datatype:ARES_DATATYPE_ABINPARES_RR_SIG_TYPE_COVEREDβ SIG Record. Type Covered. Datatype:ARES_DATATYPE_U16ARES_RR_SIG_ALGORITHMβ SIG Record. Algorithm. Datatype:ARES_DATATYPE_U8ARES_RR_SIG_LABELSβ SIG Record. Labels. Datatype:ARES_DATATYPE_U8ARES_RR_SIG_ORIGINAL_TTLβ SIG Record. Original TTL. Datatype:ARES_DATATYPE_U32ARES_RR_SIG_EXPIRATIONβ SIG Record. Signature Expiration. Datatype:ARES_DATATYPE_U32ARES_RR_SIG_INCEPTIONβ SIG Record. Signature Inception. Datatype:ARES_DATATYPE_U32ARES_RR_SIG_KEY_TAGβ SIG Record. Key Tag. Datatype:ARES_DATATYPE_U16ARES_RR_SIG_SIGNERS_NAMEβ SIG Record. Signer's Name. Datatype:ARES_DATATYPE_NAMEARES_RR_SIG_SIGNATUREβ SIG Record. Signature. Datatype:ARES_DATATYPE_BINARES_RR_AAAA_ADDRβ AAAA Record. Address. Datatype:ARES_DATATYPE_INADDR6ARES_RR_SRV_PRIORITYβ SRV Record. Priority. Datatype:ARES_DATATYPE_U16ARES_RR_SRV_WEIGHTβ SRV Record. Weight. Datatype:ARES_DATATYPE_U16ARES_RR_SRV_PORTβ SRV Record. Port. Datatype:ARES_DATATYPE_U16ARES_RR_SRV_TARGETβ SRV Record. Target domain. Datatype:ARES_DATATYPE_NAMEARES_RR_NAPTR_ORDERβ NAPTR Record. Order. Datatype:ARES_DATATYPE_U16ARES_RR_NAPTR_PREFERENCEβ NAPTR Record. Preference. Datatype:ARES_DATATYPE_U16ARES_RR_NAPTR_FLAGSβ NAPTR Record. Flags. Datatype:ARES_DATATYPE_STRARES_RR_NAPTR_SERVICESβ NAPTR Record. Services. Datatype:ARES_DATATYPE_STRARES_RR_NAPTR_REGEXPβ NAPTR Record. Regexp. Datatype:ARES_DATATYPE_STRARES_RR_NAPTR_REPLACEMENTβ NAPTR Record. Replacement. Datatype:ARES_DATATYPE_NAMEARES_RR_OPT_UDP_SIZEβ OPT Record. UDP Size. Datatype:ARES_DATATYPE_U16ARES_RR_OPT_VERSIONβ OPT Record. Version. Datatype:ARES_DATATYPE_U8ARES_RR_OPT_FLAGSβ OPT Record. Flags. Datatype:ARES_DATATYPE_U16ARES_RR_OPT_OPTIONSβ OPT Record. Options. Seeares_opt_param_t. Datatype:ARES_DATATYPE_OPTARES_RR_TLSA_CERT_USAGEβ TLSA Record. Certificate Usage. Seeares_tlsa_usage_t. Datatype:ARES_DATATYPE_U8ARES_RR_TLSA_SELECTORβ TLSA Record. Selector. Seeares_tlsa_selector_t. Datatype:ARES_DATATYPE_U8ARES_RR_TLSA_MATCHβ TLSA Record. Matching Type. Seeares_tlsa_match_t. Datatype:ARES_DATATYPE_U8ARES_RR_TLSA_DATAβ TLSA Record. Certificate Association Data. Datatype:ARES_DATATYPE_BINARES_RR_SVCB_PRIORITYβ SVCB Record. SvcPriority. Datatype:ARES_DATATYPE_U16ARES_RR_SVCB_TARGETβ SVCB Record. TargetName. Datatype:ARES_DATATYPE_NAMEARES_RR_SVCB_PARAMSβ SVCB Record. SvcParams. Seeares_svcb_param_t. Datatype:ARES_DATATYPE_OPTARES_RR_HTTPS_PRIORITYβ HTTPS Record. SvcPriority. Datatype:ARES_DATATYPE_U16ARES_RR_HTTPS_TARGETβ HTTPS Record. TargetName. Datatype:ARES_DATATYPE_NAMEARES_RR_HTTPS_PARAMSβ HTTPS Record. SvcParams. Seeares_svcb_param_t. Datatype:ARES_DATATYPE_OPTARES_RR_URI_PRIORITYβ URI Record. Priority. Datatype:ARES_DATATYPE_U16ARES_RR_URI_WEIGHTβ URI Record. Weight. Datatype:ARES_DATATYPE_U16ARES_RR_URI_TARGETβ URI Record. Target domain. Datatype:ARES_DATATYPE_NAMEARES_RR_CAA_CRITICALβ CAA Record. Critical flag. Datatype:ARES_DATATYPE_U8ARES_RR_CAA_TAGβ CAA Record. Tag/Property. Datatype:ARES_DATATYPE_STRARES_RR_CAA_VALUEβ CAA Record. Value. Datatype:ARES_DATATYPE_BINPARES_RR_RAW_RR_TYPEβ RAW Record. RR Type. Datatype:ARES_DATATYPE_U16ARES_RR_RAW_RR_DATAβ RAW Record. RR Data. Datatype:ARES_DATATYPE_BIN
not me counting them all to make sure nobody got left out β they're all here, promise π
ares_tlsa_usage_t β TLSA Record ARES_RR_TLSA_CERT_USAGE known values πΈ
the certificate usage menu, zero through three, all iconic:
ARES_TLSA_USAGE_CAβ Certificate Usage 0. CA ConstraintARES_TLSA_USAGE_SERVICEβ Certificate Usage 1. Service Certificate ConstraintARES_TLSA_USAGE_TRUSTANCHORβ Certificate Usage 2. Trust Anchor AssertionARES_TLSA_USAGE_DOMAINβ Certificate Usage 3. Domain-issued certificate
ares_tlsa_selector_t β TLSA Record ARES_RR_TLSA_SELECTOR known values π
pick your selector vibe:
ARES_TLSA_SELECTOR_FULLβ Full CertificateARES_TLSA_SELECTOR_SUBJPUBKEYINFOβ DER-encoded SubjectPublicKeyInfo
ares_tlsa_match_t β TLSA Record ARES_RR_TLSA_MATCH known values π¦
and finally the matching types, from "just compare it" to "hash it with the big girls":
ARES_TLSA_MATCH_EXACTβ Exact matchARES_TLSA_MATCH_SHA256β Sha256 matchARES_TLSA_MATCH_SHA512β Sha512 match
β¨ DESCRIPTION β¨
okay bestie, so this is the whole resource-record side of the ares DNS API, and it's a LOT, but I promise it's just "make record, poke record, read record, yeet record" over and over. Stay with me. π
π Counting, adding, grabbing and yeeting records
ares_dns_record_rr_cnt(3)β hands you back the number of resource records living inside the DNS record you passed indnsrec, but only for the section you named insect. it's giving census energy fr. πares_dns_record_rr_add(3)β adds a brand new resource record entry to the DNS record indnsrec. the fresh record gets dropped into the variable thatrr_outpoints at. which DNS section it belongs to? that'ssect. the domain name for the record isnameβ and heads up,namecan not be NULL, but it can be an empty string, or".". the record type goes intype, the DNS record class goes inrclass, and the Time To Live (TTL) goes inttl. π«Άares_dns_record_rr_get(3)andares_dns_record_rr_get_const(3)β these two pull the resource record pointer out of the DNS record indnsrec, from the section insect, at the index inidx. β οΈ thatidxmust be less than whatares_dns_record_rr_cnt(3)returns. the first one gives you a writable pointer, the second gives you a read-only pointer. pick your fighter. πares_dns_record_rr_del(3)β deletes a resource record from the DNS record indnsrec. its main character use case? removing anARES_REC_TYPE_OPTrecord when you need to retry a query without EDNS support. the RR section comes in viasect, and the index to remove comes in viaidx. and yeah β thatidxmust be less thanares_dns_record_rr_cnt(3). same rule, every time, no cap. ποΈ
π¦ Reading the basics off a record
these all take the Resource Record pointer in rr and just tell you what's on it:
ares_dns_rr_get_name(3)β grabs the resource record domain name. πΈares_dns_rr_get_type(3)β grabs the resource record type. βares_dns_rr_get_class(3)β grabs the resource record class. πares_dns_rr_get_ttl(3)β grabs the resource record class Time to Live (TTL). β³
β¨ SETTING values β¨
okay so every setter has the same little ritual: you point at the record with dns_rr, you name the key/parameter with key, and you hand over the value. the only thing that changes is which datatype it's allowed to touch. obsessed with the consistency honestly.
ares_dns_rr_set_addr(3)β sets an IPv4 address for the associated resource record key/parameter when the datatype isARES_DATATYPE_INADDR. record to modify βdns_rr, key/parameter βkey, value βaddr. πares_dns_rr_set_addr6(3)β sets an IPv6 address for the associated resource record key/parameter when the datatype isARES_DATATYPE_INADDR6. record to modify βdns_rr, key/parameter βkey, value βaddr. πares_dns_rr_set_str(3)β sets a string for the associated resource record key/parameter when the datatype isARES_DATATYPE_STRorARES_DATATYPE_NAME. π most strings are limited to 255 bytes, however some records β like a TXT record β may allow longer, because they're output as multiple strings. record to modify βdns_rr, key/parameter βkey, value βval.ares_dns_rr_set_u8(3)β sets an 8bit unsigned value for the associated resource record key/parameter when the datatype isARES_DATATYPE_U8. record to modify βdns_rr, key/parameter βkey, value βval. πares_dns_rr_set_u16(3)β sets an 16bit unsigned value for the associated resource record key/parameter when the datatype isARES_DATATYPE_U16. record to modify βdns_rr, key/parameter βkey, value βval. πares_dns_rr_set_u32(3)β sets an 32bit unsigned value for the associated resource record key/parameter when the datatype isARES_DATATYPE_U32. record to modify βdns_rr, key/parameter βkey, value βval. πares_dns_rr_set_bin(3)β sets a binary value for the associated resource record key/parameter when the datatype isARES_DATATYPE_BINorARES_DATATYPE_BINP. record to modify βdns_rr, key/parameter βkey, value βval, and the associated value length goes inlen. π§ares_dns_rr_add_abin(3)β appends a binary value into the array for the associated resource record key/parameter when the datatype isARES_DATATYPE_ABINP. record to modify βdns_rr, key/parameter βkey, value βval, and the associated value length goes inlen. it's the "one more, bestie" of setters. βares_dns_rr_del_abin(3)β deletes a binary value from the array for the associated resource record key/parameter when the datatype isARES_DATATYPE_ABINP. record to modify βdns_rr, key/parameter βkey, and the index to remove goes inidx. β
π OPT datatype things (the special ones)
ares_dns_rr_set_opt(3)β sets option/parameter keys and values for the resource record when the datatype isARES_DATATYPE_OPT. the record to modify βdns_rr. the key/parameter βkey. the option/parameter value specific to the resource record βopt, and listen, it's left to the user to determine the appropriate value to use. some known values may be provided byares_svcb_param_tandares_opt_param_tenumerations. the value for the option is always provided in binary form inval, with its length inval_len. πares_dns_rr_del_opt_byid(3)β deletes option/parameter keys and values for the resource record when the datatype isARES_DATATYPE_OPT. the record to modify βdns_rr. the key/parameter βkey. the option/parameter value specific to the resource record βopt. ποΈ this one actually reports back: it returnsARES_SUCCESSif the record is successfully removed, orARES_ENOTFOUNDif the record could not be found.
π GETTING values π
same ritual as the setters but backwards: record in dns_rr, key/parameter in key, and you get a value out. every one of these only works when the datatype matches, so vibe check your datatype first, fr fr.
ares_dns_rr_get_addr(3)β retrieves the IPv4 address from the resource record when the datatype isARES_DATATYPE_INADDR. record βdns_rr, key/parameter to retrieve βkey. πares_dns_rr_get_addr6(3)β retrieves the IPv6 address from the resource record when the datatype isARES_DATATYPE_INADDR6. record βdns_rr, key/parameter to retrieve βkey. πares_dns_rr_get_str(3)β retrieves a string from the resource record when the datatype isARES_DATATYPE_STRorARES_DATATYPE_NAME. record βdns_rr, key/parameter to retrieve βkey. πares_dns_rr_get_u8(3)β retrieves an 8bit integer from the resource record when the datatype isARES_DATATYPE_U8. record βdns_rr, key/parameter to retrieve βkey. π’ares_dns_rr_get_u16(3)β retrieves a 16bit integer from the resource record when the datatype isARES_DATATYPE_U16. record βdns_rr, key/parameter to retrieve βkey. π’ares_dns_rr_get_u32(3)β retrieves a 32bit integer from the resource record when the datatype isARES_DATATYPE_U32. record βdns_rr, key/parameter to retrieve βkey. π’ares_dns_rr_get_bin(3)β retrieves binary data from the resource record when the datatype isARES_DATATYPE_BINorARES_DATATYPE_BINP. record βdns_rr, key/parameter to retrieve βkey, and the length gets stored into the variable thatlenpoints at. π§ares_dns_rr_get_abin_cnt(3)β retrieves the count of the array of stored binary values from the resource record when the datatype isARES_DATATYPE_ABINP. record βdns_rr, key/parameter to retrieve βkey. π’ares_dns_rr_get_abin(3)β retrieves binary data from the resource record array when the datatype isARES_DATATYPE_ABINP. record βdns_rr, key/parameter to retrieve βkey, the index to retrieve from the array βidx, and the length gets stored into the variable thatlenpoints at. π§ares_dns_rr_get_opt_cnt(3)β retrieves the count of options/parameters associated with the resource record when the datatype isARES_DATATYPE_OPT. record βdns_rr, key/parameter to retrieve βkey. π’ares_dns_rr_get_opt(3)β retrieves binary option data from the resource record when the datatype isARES_DATATYPE_OPT, for the specified index. record βdns_rr, key/parameter to retrieve βkey, index to retrieve the option data from βidx. the value gets stored into the variable thatvalpoints at, and the length gets stored into the variable thatval_lenpoints at. πares_dns_rr_get_opt_byid(3)β retrieves binary option data from the resource record when the datatype isARES_DATATYPE_OPT, for the specified option identifier β if it exists. record βdns_rr, key/parameter to retrieve βkey, identifier to retrieve the option data from βopt. the value gets stored into the variable thatvalpoints at, and the length gets stored into the variable thatval_lenpoints at. π₯
β¨ RETURN VALUES β¨
okay bestie, gather round, here's what these babies hand back to you π
ares_dns_record_rr_cnt(3)andares_dns_rr_get_opt_cnt(3)just return the respective counts. that's it, that's the whole vibe. no drama, no error codes, just numbers. πares_dns_record_rr_add(3),ares_dns_record_rr_del(3),ares_dns_rr_set_addr(3),ares_dns_rr_set_addr6(3),ares_dns_rr_set_str(3),ares_dns_rr_set_u8(3),ares_dns_rr_set_u16(3),ares_dns_rr_set_u32(3),ares_dns_rr_set_bin(3),ares_dns_rr_add_abin(3),ares_dns_rr_del_abin(3), andares_dns_rr_set_opt(3)β all of these return anares_status_terror code. here's the tea:ARES_SUCCESSβ returned on success π slayARES_ENOMEMβ returned on out of memory π we been thereARES_EFORMERRβ returned on misuse π like, bestie, that's on you
ares_dns_rr_get_name(3),ares_dns_rr_get_type(3),ares_dns_rr_get_class(3),ares_dns_rr_get_ttl(3),ares_dns_rr_get_addr(3),ares_dns_rr_get_addr6(3),ares_dns_rr_get_str(3),ares_dns_rr_get_u8(3),ares_dns_rr_get_u16(3),ares_dns_rr_get_u32(3),ares_dns_rr_get_bin(3),ares_dns_rr_get_abin_cnt(3),ares_dns_rr_get_abin(3),ares_dns_rr_get_opt(3)β all of these return their prescribed datatype values and in general can't fail except for misuse cases, in which a0(orNULL) may be returned. and here's the plot twist π« :0can also be a valid return value for most of these functions. so like, don't go reading too much into a0, iykyk.ares_dns_record_rr_get(3)andares_dns_record_rr_get_const(3)will return the requested resource record pointer, orNULLon failure (misuse). no in-between, no crumbs. πares_dns_rr_get_opt_byid(3)will returnARES_TRUEif the option was found, otherwiseARES_FALSEif not found (or misuse). literally just a yes or no moment. π
π AVAILABILITY π
these functions were first introduced in c-ares version 1.22.0. so if you're on something older than that... bestie. no they're not there. upgrade. π§
π¦ SEE ALSO π¦
and that's the whole page, bestie!! π source/version says we're rolling with ARES_DNS_RR(3) dated 12 November 2023 β go forth and parse some DNS records, you absolute icon ππβ¨
π¦ where this page comes from
- alpine 3.22: c-ares-doc 1.34.9-r0 Β· MIT
- alpine 3.23: c-ares-doc 1.34.9-r0 Β· MIT
- alpine 3.24: c-ares-doc 1.34.9-r0 Β· MIT
- arch rolling: c-ares 1.34.9-1 Β· MIT
- centos-stream 10: c-ares-devel 1.34.9-1.el10 Β· MIT
- debian trixie: libc-ares-dev 1.34.5-1+deb13u1 Β· MIT
- fedora 43: c-ares-devel 1.34.5-2.fc43 Β· MIT
- fedora 43: c-ares-devel 1.34.5-2.fc43 Β· MIT
- fedora 43: c-ares-devel 1.34.8-1.fc43 Β· MIT
- fedora 43: c-ares-devel 1.34.8-1.fc43 Β· MIT
- fedora 44: c-ares-devel 1.34.6-3.fc44 Β· MIT
- fedora 44: c-ares-devel 1.34.6-3.fc44 Β· MIT
- fedora 44: c-ares-devel 1.34.8-1.fc44 Β· MIT
- fedora 44: c-ares-devel 1.34.8-1.fc44 Β· MIT
- nixos 26.05: c-ares 1.34.9
- nixpkgs unstable: c-ares 1.34.8
- opensuse-leap 16.0: c-ares-devel 1.34.8-160000.1.1 Β· MIT
- opensuse-leap 16.0: c-ares-devel 1.34.8-160000.1.1 Β· MIT
- opensuse-leap 16.0: c-ares-devel 1.34.8-160000.1.1 Β· MIT
- opensuse-leap 16.0: c-ares-devel 1.34.8-160000.1.1 Β· MIT
- ubuntu questing: libc-ares-dev 1.34.5-1
- ubuntu questing: libc-ares-dev 1.34.5-1ubuntu0.1
- ubuntu resolute: libc-ares-dev 1.34.6-1 Β· MIT
- ubuntu resolute: libc-ares-dev 1.34.6-1ubuntu0.1
- ubuntu resolute: libc-ares-dev 1.34.6-1ubuntu0.2 Β· MIT
- ubuntu stonking: libc-ares-dev 1.34.8-1 Β· MIT
- π the page's license: MIT
- Copyright (C) 2023 The c-ares project and its contributors
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms