SPDX-License-Identifier: MIT
#include <ares.h> void ares_dns_record_destroy(ares_dns_record_t *dnsrec); ares_status_t ares_dns_parse(const unsigned char *buf, size_t buf_len, unsigned int flags, ares_dns_record_t **dnsrec); ares_status_t ares_dns_write(ares_dns_record_t *dnsrec, unsigned char **buf, size_t *buf_len); ares_status_t ares_dns_record_create(ares_dns_record_t **dnsrec, unsigned short id, unsigned short flags, ares_dns_opcode_t opcode, ares_dns_rcode_t rcode); unsigned short ares_dns_record_get_id(const ares_dns_record_t *dnsrec); unsigned short ares_dns_record_get_flags(const ares_dns_record_t *dnsrec); ares_dns_opcode_t ares_dns_record_get_opcode(const ares_dns_record_t *dnsrec); ares_dns_rcode_t ares_dns_record_get_rcode(const ares_dns_record_t *dnsrec); ares_status_t ares_dns_record_query_add(ares_dns_record_t *dnsrec, const char *name, ares_dns_rec_type_t qtype, ares_dns_class_t qclass); size_t ares_dns_record_query_cnt(const ares_dns_record_t *dnsrec); ares_status_t ares_dns_record_query_get(const ares_dns_record_t *dnsrec, size_t idx, const char **name, ares_dns_rec_type_t *qtype, ares_dns_class_t *qclass);
ARES_REC_TYPE_A - Host address
ARES_REC_TYPE_NS - Authoritative server
ARES_REC_TYPE_CNAME - Canonical name
ARES_REC_TYPE_SOA - Start of authority zone
ARES_REC_TYPE_PTR - Domain name pointer
ARES_REC_TYPE_HINFO - Host information
ARES_REC_TYPE_MX - Mail routing information
ARES_REC_TYPE_TXT - Text strings
ARES_REC_TYPE_AAAA - RFC 3596. Ip6 Address
ARES_REC_TYPE_SRV - RFC 2782. Server Selection
ARES_REC_TYPE_NAPTR - RFC 3403. Naming Authority Pointer
ARES_REC_TYPE_OPT - RFC 6891. EDNS0 option (meta-RR). Pseudo Record.
ARES_REC_TYPE_TLSA - RFC 6698. DNS-Based Authentication of Named Entities (DANE) Transport Layer Security (TLS) Protocol: TLSA
ARES_REC_TYPE_SVCB - RFC 9460. General Purpose Service Binding
ARES_REC_TYPE_HTTPS - - RFC 9460. Service Binding type for use with HTTPS
ARES_REC_TYPE_ANY - Wildcard match. Not response RR
ARES_REC_TYPE_URI - RFC 7553. Uniform Resource Identifier
ARES_REC_TYPE_CAA - RFC 6844. Certification Authority Authorization
ARES_REC_TYPE_RAW_RR - Used as an indicator that the RR record is not parsed, but provided in wire format
ARES_CLASS_IN - Internet
ARES_CLASS_CHAOS - CHAOS
ARES_CLASS_HESOID - Hesoid [Dyer 87]
ARES_CLASS_NONE - RFC 2136
ARES_CLASS_ANY - Any class (requests only)
ARES_OPCODE_QUERY - Standard query
ARES_OPCODE_IQUERY - Inverse query. Obsolete
ARES_OPCODE_STATUS - Name server status query
ARES_OPCODE_NOTIFY - Zone change notification (RFC 1996)
ARES_OPCODE_UPDATE - Zone update message (RFC2136)
ARES_FLAG_QR - QR. If set, is a response
ARES_FLAG_AA - Authoritative Answer. If set, is authoritative
ARES_FLAG_TC - Truncation. If set, is truncated response
ARES_FLAG_RD - Recursion Desired. If set, recursion is desired
ARES_FLAG_RA - Recursion Available. If set, server supports recursion
ARES_FLAG_AD - RFC 2065. Authentic Data bit indicates in a response that the data included has been verified by the server providing it
ARES_FLAG_CD - RFC 2065. Checking Disabled bit indicates in a query that non-verified data is acceptable to the resolver sending the query
ARES_RCODE_NOERROR - Success
ARES_RCODE_FORMERR - Format error. The name server was unable to interpret the query
ARES_RCODE_SERVFAIL - Server Failure. The name server was unable to process this query due to a problem with the nameserver
ARES_RCODE_NXDOMAIN - Name Error. Meaningful only for responses from an authoritative name server, this code signifies that the domain name referenced in the query does not exist.
ARES_RCODE_NOTIMP - Not implemented. The name server does not support the requested kind of query
ARES_RCODE_REFUSED - Refused. The name server refuses to perform the specified operation for policy reasons.
ARES_RCODE_YXDOMAIN - RFC 2136. Some name that ought not to exist, does exist
ARES_RCODE_YXRRSET - RFC 2136. Some RRset that ought to not exist, does exist
ARES_RCODE_NXRRSET - RFC 2136. Some RRset that ought to exist, does not exist
ARES_RCODE_NOTAUTH - RFC 2136. The server is not authoritative for the zone named in the Zone section.
ARES_RCODE_NOTZONE - RFC 2136. A name used in the Prerequisite or Update Section is not within the zone denoted by the Zone Section.
ARES_RCODE_DSOTYPEI - RFC 8409. DSO-TYPE Not implemented
ARES_RCODE_BADSIG - RFC 8945. TSIG Signature Failure
ARES_RCODE_BADKEY - RFC 8945. Key not recognized
ARES_RCODE_BADTIME - RFC 8945. Signature out of time window
ARES_RCODE_BADMODE - RFC 2930. Bad TKEY Mode
ARES_RCODE_BADNAME - RFC 2930. Duplicate Key Name
ARES_RCODE_BADALG - RFC 2930. Algorithm not supported
ARES_RCODE_BADTRUNC - RFC 8945. Bad Truncation
ARES_RCODE_BADCOOKIE - RFC 7973. Bad/missing Server Cookie
ARES_DNS_PARSE_AN_BASE_RAW - Parse Answer Section from RFC 1035 that allow name compression as RAW RR type
ARES_DNS_PARSE_NS_BASE_RAW - Parse Authority Section from RFC 1035 that allow name compression as RAW RR type
ARES_DNS_PARSE_AR_BASE_RAW - Parse Additional Section from RFC 1035 that allow name compression as RAW RR type
ARES_DNS_PARSE_AN_EXT_RAW - Parse Answer Section from later RFCs (no name compression) as RAW RR type
ARES_DNS_PARSE_NS_EXT_RAW - Parse Authority Section from later RFCs (no name compression) as RAW RR type
ARES_DNS_PARSE_AR_EXT_RAW - Parse Additional Section from later RFCs (no name compression) as RAW RR type