Skip to content

Fix CNAME chain handling when querying for a CNAME#20

Merged
foxcpp merged 2 commits intofoxcpp:masterfrom
mailgun:master
Jan 3, 2026
Merged

Fix CNAME chain handling when querying for a CNAME#20
foxcpp merged 2 commits intofoxcpp:masterfrom
mailgun:master

Conversation

@horkhe
Copy link
Contributor

@horkhe horkhe commented Dec 29, 2025

The repository looks abandoned but I decided to make this PR anyway.

  • When CNAME is requested (e.g. LookupCNAME) only the top level CNAME record should be returned if existed. Previously server followed chain of CNAME records until a non-CNAME is reached and returned it. This is not how actual DNS server behaves. Note that behaviour to follow a CNAME chain when querying any other record is preserved, because that is how actual DNS server behaves.
  • When there is chain of CNAMEs a request for any other record includes entire chain to the answer. Previously only one bogus CNAME record was included in the answer. from the original CNAME to the terminal non-CNAME record.
  • SkipCNAMEs flag is ignored as no longer making any sense, but preserved in the code for backwards compatibility.

@foxcpp foxcpp merged commit f736582 into foxcpp:master Jan 3, 2026
@foxcpp
Copy link
Owner

foxcpp commented Jan 3, 2026

Thanks!

@horkhe
Copy link
Contributor Author

horkhe commented Jan 5, 2026

Wow, Grandfather Frost acted unexpectedly fast this year ). Thank you! Could you please also tag the master, so we can update our go.mod.

@foxcpp
Copy link
Owner

foxcpp commented Jan 6, 2026

Done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants