---
name: "ldns_rr_class"
section: "3"
platform: "linux"
package: "ldns"
version: "1.9.2-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/ldns_rr_class"
---

# ldns\_rr\_class(3)

types representing dns resource records

## NAME

ldns\_rr, ldns\_rr\_class, ldns\_rr\_type, ldns\_rr\_compress, ldns\_rr\_list - types representing dns resource records

## SYNOPSIS

\#include \<stdint.h\>\
 \#include \<stdbool.h\>\

\#include \<ldns/ldns.h\>

## DESCRIPTION

*ldns\_rr*\
 Resource Record\

This is the basic DNS element that contains actual data\

From RFC1035:\
 \<pre\>\
 3\.2.1. Format\

All RRs have the same top level format shown below:\

                                    1  1  1  1  1  1\
\
       0  1  2  3  4  5  6  7  8  9  0  1  2  3  4  5\
\
     \+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+\
\
     \|                                               \|\
\
     /                                               /\
\
     /                      NAME                     /\
\
     \|                                               \|\
\
     \+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+\
\
     \|                      TYPE                     \|\
\
     \+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+\
\
     \|                     CLASS                     \|\
\
     \+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+\
\
     \|                      TTL                      \|\
\
     \|                                               \|\
\
     \+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+\
\
     \|                   RDLENGTH                    \|\
\
     \+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--\|\
\
     /                     RDATA                     /\
\
     /                                               /\
\
     \+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+\

where:\

NAME            an owner name, i.e., the name of the node to which this\
\
                 resource record pertains.\

TYPE            two octets containing one of the RR TYPE codes.\

CLASS           two octets containing one of the RR CLASS codes.\

TTL             a 32 bit signed integer that specifies the time interval\
\
                 that the resource record may be cached before the source\
\
                 of the information should again be consulted.  Zero\
\
                 values are interpreted to mean that the RR can only be\
\
                 used for the transaction in progress, and should not be\
\
                 cached.  For example, SOA records are always distributed\
\
                 with a zero TTL to prohibit caching.  Zero values can\
\
                 also be used for extremely volatile data.\

RDLENGTH        an unsigned 16 bit integer that specifies the length in\
\
                 octets of the RDATA field.\

RDATA           a variable length string of octets that describes the\
\
                 resource.  The format of this information varies\
\
                 according to the TYPE and CLASS of the resource record.\
 \</pre\>\

The actual amount and type of rdata fields depend on the RR type of the\
 RR, and can be found by using \\ref ldns\_rr\_descriptor functions.\
 struct ldns\_struct\_rr\
 {\
\
 	**Owner name, uncompressed:**\
\
 	ldns\_rdf	\*\_owner;\
\
 	**Time to live:**\
\
 	uint32\_t	\_ttl;\
\
 	**Number of data fields:**\
\
 	size\_t	        \_rd\_count;\
\
 	**the type of the RR. A, MX etc.:**\
\
 	ldns\_rr\_type	\_rr\_type;\
\
 	**Class of the resource record.:**\
\
 	ldns\_rr\_class	\_rr\_class;\
\
 	/\* everything in the rdata is in network order \*/\
\
 	**The array of rdata's:**\
\
 	ldns\_rdf	 \*\*\_rdata\_fields;\
\
 	/\*\*  question rr \[it would be nicer if thous is after \_rd\_count\]\
\
 		 ABI change: Fix this in next major release\
\
 	 \*/\
\
 	bool		\_rr\_question;\
 };\
 typedef struct ldns\_struct\_rr ldns\_rr;

*ldns\_rr\_class*\
\
  The different RR classes.\
 enum ldns\_enum\_rr\_class\
 {\
\
 	**the Internet:**\
\
 	LDNS\_RR\_CLASS\_IN 	= 1,\
\
 	**Chaos class:**\
\
 	LDNS\_RR\_CLASS\_CH	= 3,\
\
 	**Hesiod (Dyer 87):**\
\
 	LDNS\_RR\_CLASS\_HS	= 4,\
\
     **None class, dynamic update:**\
\
     LDNS\_RR\_CLASS\_NONE      = 254,\
\
 	**Any class:**\
\
 	LDNS\_RR\_CLASS\_ANY	= 255,\

	LDNS\_RR\_CLASS\_FIRST     = 0,\
\
 	LDNS\_RR\_CLASS\_LAST      = 65535,\
\
 	LDNS\_RR\_CLASS\_COUNT     = LDNS\_RR\_CLASS\_LAST - LDNS\_RR\_CLASS\_FIRST + 1\
 };\
 typedef enum ldns\_enum\_rr\_class ldns\_rr\_class;

*ldns\_rr\_type*\
 The different RR types.\
 enum ldns\_enum\_rr\_type\
 {\
\
 	**a host address:**\
\
 	LDNS\_RR\_TYPE\_A = 1,\
\
 	**an authoritative name server:**\
\
 	LDNS\_RR\_TYPE\_NS = 2,\
\
 	**a mail destination (Obsolete - use MX):**\
\
 	LDNS\_RR\_TYPE\_MD = 3,\
\
 	**a mail forwarder (Obsolete - use MX):**\
\
 	LDNS\_RR\_TYPE\_MF = 4,\
\
 	**the canonical name for an alias:**\
\
 	LDNS\_RR\_TYPE\_CNAME = 5,\
\
 	**marks the start of a zone of authority:**\
\
 	LDNS\_RR\_TYPE\_SOA = 6,\
\
 	**a mailbox domain name (EXPERIMENTAL):**\
\
 	LDNS\_RR\_TYPE\_MB = 7,\
\
 	**a mail group member (EXPERIMENTAL):**\
\
 	LDNS\_RR\_TYPE\_MG = 8,\
\
 	**a mail rename domain name (EXPERIMENTAL):**\
\
 	LDNS\_RR\_TYPE\_MR = 9,\
\
 	**a null RR (EXPERIMENTAL):**\
\
 	LDNS\_RR\_TYPE\_NULL = 10,\
\
 	**a well known service description:**\
\
 	LDNS\_RR\_TYPE\_WKS = 11,\
\
 	**a domain name pointer:**\
\
 	LDNS\_RR\_TYPE\_PTR = 12,\
\
 	**host information:**\
\
 	LDNS\_RR\_TYPE\_HINFO = 13,\
\
 	**mailbox or mail list information:**\
\
 	LDNS\_RR\_TYPE\_MINFO = 14,\
\
 	**mail exchange:**\
\
 	LDNS\_RR\_TYPE\_MX = 15,\
\
 	**text strings:**\
\
 	LDNS\_RR\_TYPE\_TXT = 16,\
\
 	**RFC1183:**\
\
 	LDNS\_RR\_TYPE\_RP = 17,\
\
 	**RFC1183:**\
\
 	LDNS\_RR\_TYPE\_AFSDB = 18,\
\
 	**RFC1183:**\
\
 	LDNS\_RR\_TYPE\_X25 = 19,\
\
 	**RFC1183:**\
\
 	LDNS\_RR\_TYPE\_ISDN = 20,\
\
 	**RFC1183:**\
\
 	LDNS\_RR\_TYPE\_RT = 21,\
\
 	**RFC1706:**\
\
 	LDNS\_RR\_TYPE\_NSAP = 22,\
\
 	**RFC1348:**\
\
 	LDNS\_RR\_TYPE\_NSAP\_PTR = 23,\
\
 	**2535typecode:**\
\
 	LDNS\_RR\_TYPE\_SIG = 24,\
\
 	**2535typecode:**\
\
 	LDNS\_RR\_TYPE\_KEY = 25,\
\
 	**RFC2163:**\
\
 	LDNS\_RR\_TYPE\_PX = 26,\
\
 	**RFC1712:**\
\
 	LDNS\_RR\_TYPE\_GPOS = 27,\
\
 	**ipv6 address:**\
\
 	LDNS\_RR\_TYPE\_AAAA = 28,\
\
 	**LOC record  RFC1876:**\
\
 	LDNS\_RR\_TYPE\_LOC = 29,\
\
 	**2535typecode:**\
\
 	LDNS\_RR\_TYPE\_NXT = 30,\
\
 	**draft-ietf-nimrod-dns-01.txt:**\
\
 	LDNS\_RR\_TYPE\_EID = 31,\
\
 	**draft-ietf-nimrod-dns-01.txt:**\
\
 	LDNS\_RR\_TYPE\_NIMLOC = 32,\
\
 	**SRV record RFC2782:**\
\
 	LDNS\_RR\_TYPE\_SRV = 33,\
\
 	**http://www.jhsoft.com/rfc/af-saa-0069.000.rtf:**\
\
 	LDNS\_RR\_TYPE\_ATMA = 34,\
\
 	**RFC2915:**\
\
 	LDNS\_RR\_TYPE\_NAPTR = 35,\
\
 	**RFC2230:**\
\
 	LDNS\_RR\_TYPE\_KX = 36,\
\
 	**RFC2538:**\
\
 	LDNS\_RR\_TYPE\_CERT = 37,\
\
 	**RFC2874:**\
\
 	LDNS\_RR\_TYPE\_A6 = 38,\
\
 	**RFC2672:**\
\
 	LDNS\_RR\_TYPE\_DNAME = 39,\
\
 	**dnsind-kitchen-sink-02.txt:**\
\
 	LDNS\_RR\_TYPE\_SINK = 40,\
\
 	**OPT record RFC 6891:**\
\
 	LDNS\_RR\_TYPE\_OPT = 41,\
\
 	**RFC3123:**\
\
 	LDNS\_RR\_TYPE\_APL = 42,\
\
 	**RFC4034, RFC3658:**\
\
 	LDNS\_RR\_TYPE\_DS = 43,\
\
 	**SSH Key Fingerprint:**\
\
 	LDNS\_RR\_TYPE\_SSHFP = 44, /\* RFC 4255 \*/\
\
 	**IPsec Key:**\
\
 	LDNS\_RR\_TYPE\_IPSECKEY = 45, /\* RFC 4025 \*/\
\
 	**DNSSEC:**\
\
 	LDNS\_RR\_TYPE\_RRSIG = 46, /\* RFC 4034 \*/\
\
 	LDNS\_RR\_TYPE\_NSEC = 47, /\* RFC 4034 \*/\
\
 	LDNS\_RR\_TYPE\_DNSKEY = 48, /\* RFC 4034 \*/\

	LDNS\_RR\_TYPE\_DHCID = 49, /\* RFC 4701 \*/\
\
 	/\* NSEC3 \*/\
\
 	LDNS\_RR\_TYPE\_NSEC3 = 50, /\* RFC 5155 \*/\
\
 	LDNS\_RR\_TYPE\_NSEC3PARAM = 51, /\* RFC 5155 \*/\
\
 	LDNS\_RR\_TYPE\_NSEC3PARAMS = 51,\
\
 	LDNS\_RR\_TYPE\_TLSA = 52, /\* RFC 6698 \*/\
\
 	LDNS\_RR\_TYPE\_SMIMEA = 53, /\* RFC 8162 \*/\

	LDNS\_RR\_TYPE\_HIP = 55, /\* RFC 5205 \*/\

	**draft-reid-dnsext-zs:**\
\
 	LDNS\_RR\_TYPE\_NINFO = 56,\
\
 	**draft-reid-dnsext-rkey:**\
\
 	LDNS\_RR\_TYPE\_RKEY = 57,\
\
         **draft-ietf-dnsop-trust-history:**\
\
         LDNS\_RR\_TYPE\_TALINK = 58,\
\
 	LDNS\_RR\_TYPE\_CDS = 59, /\* RFC 7344 \*/\
\
 	LDNS\_RR\_TYPE\_CDNSKEY = 60, /\* RFC 7344 \*/\
\
 	LDNS\_RR\_TYPE\_OPENPGPKEY = 61, /\* RFC 7929 \*/\
\
 	LDNS\_RR\_TYPE\_CSYNC = 62, /\* RFC 7477 \*/\
\
 	LDNS\_RR\_TYPE\_ZONEMD = 63, /\* RFC 8976 \*/\
\
 	LDNS\_RR\_TYPE\_SVCB = 64, /\* RFC 9460 \*/\
\
 	LDNS\_RR\_TYPE\_HTTPS = 65, /\* RFC 9460 \*/\
\
 	LDNS\_RR\_TYPE\_DSYNC = 66, /\* RFC 9859 \*/\
\
 	LDNS\_RR\_TYPE\_HHIT = 67, /\* draft-ietf-drip-registries-28 \*/\
\
 	LDNS\_RR\_TYPE\_BRID = 68, /\* draft-ietf-drip-registries-28 \*/\

	LDNS\_RR\_TYPE\_SPF = 99, /\* RFC 4408 \*/\

	LDNS\_RR\_TYPE\_UINFO = 100,\
\
 	LDNS\_RR\_TYPE\_UID = 101,\
\
 	LDNS\_RR\_TYPE\_GID = 102,\
\
 	LDNS\_RR\_TYPE\_UNSPEC = 103,\

	LDNS\_RR\_TYPE\_NID = 104, /\* RFC 6742 \*/\
\
 	LDNS\_RR\_TYPE\_L32 = 105, /\* RFC 6742 \*/\
\
 	LDNS\_RR\_TYPE\_L64 = 106, /\* RFC 6742 \*/\
\
 	LDNS\_RR\_TYPE\_LP = 107, /\* RFC 6742 \*/\

	LDNS\_RR\_TYPE\_EUI48 = 108, /\* RFC 7043 \*/\
\
 	LDNS\_RR\_TYPE\_EUI64 = 109, /\* RFC 7043 \*/\

	LDNS\_RR\_TYPE\_NXNAME = 128, /\* RFC 9824 \*/\

	LDNS\_RR\_TYPE\_TKEY = 249, /\* RFC 2930 \*/\
\
 	LDNS\_RR\_TYPE\_TSIG = 250,\
\
 	LDNS\_RR\_TYPE\_IXFR = 251,\
\
 	LDNS\_RR\_TYPE\_AXFR = 252,\
\
 	**A request for mailbox-related records (MB, MG or MR):**\
\
 	LDNS\_RR\_TYPE\_MAILB = 253,\
\
 	**A request for mail agent RRs (Obsolete - see MX):**\
\
 	LDNS\_RR\_TYPE\_MAILA = 254,\
\
 	**any type (wildcard):**\
\
 	LDNS\_RR\_TYPE\_ANY = 255,\
\
 	LDNS\_RR\_TYPE\_URI = 256, /\* RFC 7553 \*/\
\
 	LDNS\_RR\_TYPE\_CAA = 257, /\* RFC 6844 \*/\
\
 	LDNS\_RR\_TYPE\_AVC = 258, /\* Cisco's DNS-AS RR, see www.dns-as.org \*/\
\
 	LDNS\_RR\_TYPE\_DOA = 259, /\* draft-durand-doa-over-dns \*/\

	**RFC 8777 \*:**\
\
 	LDNS\_RR\_TYPE\_AMTRELAY = 260,\

	**RFC 9606:**\
\
 	LDNS\_RR\_TYPE\_RESINFO = 261,\

	**https://iana.org/assignments/dns-parameters/WALLET/wallet-completed-template:**\
\
 	LDNS\_RR\_TYPE\_WALLET = 262,\

	**https://www.iana.org/assignments/dns-parameters/CLA/cla-completed-template:**\
\
 	LDNS\_RR\_TYPE\_CLA = 263,\

	**https://www.iana.org/assignments/dns-parameters/IPN/ipn-completed-template:**\
\
 	LDNS\_RR\_TYPE\_IPN = 264,\

	**DNSSEC Trust Authorities:**\
\
 	LDNS\_RR\_TYPE\_TA = 32768,\
\
 	/\* RFC 4431, 5074, DNSSEC Lookaside Validation \*/\
\
 	LDNS\_RR\_TYPE\_DLV = 32769,\

	/\* type codes from nsec3 experimental phase\
\
 	LDNS\_RR\_TYPE\_NSEC3 = 65324,\
\
 	LDNS\_RR\_TYPE\_NSEC3PARAMS = 65325, \*/\
\
 	LDNS\_RR\_TYPE\_FIRST = 0,\
\
 	LDNS\_RR\_TYPE\_LAST  = 65535,\
\
 	LDNS\_RR\_TYPE\_COUNT = LDNS\_RR\_TYPE\_LAST - LDNS\_RR\_TYPE\_FIRST + 1\
 };\
 typedef enum ldns\_enum\_rr\_type ldns\_rr\_type;

*ldns\_rr\_compress*\
\
  Used to specify whether compression is allowed.\
 enum ldns\_enum\_rr\_compress\
 {\
\
 	**compression is allowed:**\
\
 	LDNS\_RR\_COMPRESS,\
\
 	LDNS\_RR\_NO\_COMPRESS\
 };\
 typedef enum ldns\_enum\_rr\_compress ldns\_rr\_compress;

*ldns\_rr\_list*\
 List or Set of Resource Records\

Contains a list of rr's \<br\>\
 No official RFC-like checks are made\
 struct ldns\_struct\_rr\_list\
 {\
\
 	size\_t \_rr\_count;\
\
 	size\_t \_rr\_capacity;\
\
 	ldns\_rr \*\*\_rrs;\
 };\
 typedef struct ldns\_struct\_rr\_list ldns\_rr\_list;

## AUTHOR

The ldns team at NLnet Labs.

## REPORTING BUGS

Please report bugs to dns-team@nlnetlabs.nl or on GitHub at https://github.com/NLnetLabs/ldns/issues

## COPYRIGHT

Copyright (c) 2004 - 2006 NLnet Labs.

Licensed under the BSD License. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

## SEE ALSO

*ldns\_rr\_new*, *ldns\_rr\_new\_frm\_type*, *ldns\_rr\_new\_frm\_str*, *ldns\_rr\_new\_frm\_fp*, *ldns\_rr\_free*, *ldns\_rr\_print*, *ldns\_rr\_set\_owner*, *ldns\_rr\_set\_ttl*, *ldns\_rr\_set\_type*, *ldns\_rr\_set\_rd\_count*, *ldns\_rr\_set\_class*, *ldns\_rr\_set\_rdf*, *ldns\_rr\_push\_rdf*, *ldns\_rr\_pop\_rdf*, *ldns\_rr\_rdf*, *ldns\_rr\_owner*, *ldns\_rr\_rd\_count*, *ldns\_rr\_ttl*, *ldns\_rr\_get\_class*, *ldns\_rr\_list\_rr\_count*, *ldns\_rr\_list\_set\_rr\_count*, *ldns\_rr\_list\_new*, *ldns\_rr\_list\_free*, *ldns\_rr\_list\_cat*, *ldns\_rr\_list\_push\_rr*, *ldns\_rr\_list\_pop\_rr*, *ldns\_is\_rrset*, *ldns\_rr\_set\_push\_rr*, *ldns\_rr\_set\_pop\_rr*, *ldns\_get\_rr\_class\_by\_name*, *ldns\_get\_rr\_type\_by\_name*, *ldns\_rr\_list\_clone*, *ldns\_rr\_list\_sort*, *ldns\_rr\_compare*, *ldns\_rr\_compare\_ds*, *ldns\_rr\_uncompressed\_size*, *ldns\_rr2canonical*, *ldns\_rr\_label\_count*, *ldns\_is\_rrset*, *ldns\_rr\_descriptor*, *ldns\_rr\_descript*. And **perldoc Net::DNS**, **RFC1034**, **RFC1035**, **RFC4033**, **RFC4034**  and **RFC4035**.

## REMARKS

This manpage was automatically generated from the ldns source code.
