Fix CNAME and glue record behavior

This commit is contained in:
Dessa Simpson 2025-12-02 01:32:34 -07:00
parent 07da2a1269
commit fa4f5ba7ab
3 changed files with 28 additions and 11 deletions

View file

@ -181,8 +181,15 @@ func TestFullZone(t *testing.T) {
assertRecord(t, res.Answer[0].Record, "CNAME", 3600, "example.com")
})
t.Run("Lookup www.example.com TXT", func(t *testing.T) {
res, ok := zFull.LookupType("www.example.com", "TXT")
t.Run("LookupType www.example.com A", func(t *testing.T) {
res, ok := zFull.LookupType("www.example.com", "CNAME")
assertOk(t, ok)
assertRecordCount(t, res, 1)
assertRecord(t, res.Answer[0].Record, "CNAME", 3600, "example.com")
})
t.Run("LookupType mail.example.com TXT", func(t *testing.T) {
res, ok := zFull.LookupType("mail.example.com", "TXT")
assertOk(t, ok)
assertRecordCount(t, res, 0)
})