---
name: "ldns_rr_compare"
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_compare"
---

# ldns\_rr\_compare(3)

compare a ldns\_rr

## NAME

ldns\_rr\_compare, ldns\_rr\_compare\_ds - compare a ldns\_rr

## SYNOPSIS

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

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

int ldns\_rr\_compare(const ldns\_rr \*rr1, const ldns\_rr \*rr2);

bool ldns\_rr\_compare\_ds(const ldns\_rr \*rr1, const ldns\_rr \*rr2);

## DESCRIPTION

*ldns\_rr\_compare*() compares two rrs. The TTL is not looked at. .br **rr1**: the first one .br **rr2**: the second one .br Returns 0 if equal -1 if rr1 comes before rr2 +1 if rr2 comes before rr1

*ldns\_rr\_compare\_ds*() returns true of the given rr's are equal. Also returns true if one record is a DS that represents the same DNSKEY record as the other record .br **rr1**: the first rr .br **rr2**: the second rr .br Returns true if equal otherwise false

## 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*, *ldns\_rr\_list*. And **perldoc Net::DNS**, **RFC1034**, **RFC1035**, **RFC4033**, **RFC4034**  and **RFC4035**.

## REMARKS

This manpage was automatically generated from the ldns source code.
