Add a CAA typed record builder for RFC 8659.

CheckDNS needs this so domain files with CAA records can be reconciled instead of failing the zone check.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Konrad Neitzel
2026-09-05 14:56:08 +02:00
co-authored by Cursor
parent 959a0ca9f9
commit 4f1a35dedb
3 changed files with 26 additions and 1 deletions
+15
View File
@@ -137,6 +137,21 @@ func TestPTRBuilder(t *testing.T) {
}
}
func TestCAABuilder(t *testing.T) {
t.Parallel()
rec, err := godns.CAA("example.test", 3600, 0, "issue", "letsencrypt.org")
if err != nil {
t.Fatal(err)
}
if rec.Type != "CAA" {
t.Fatalf("type: %q", rec.Type)
}
if rec.RData != `0 issue "letsencrypt.org"` {
t.Fatalf("rdata: %q", rec.RData)
}
}
func TestBuilderRejectsNonASCIIOwner(t *testing.T) {
t.Parallel()