Skip to content

Update CNAME resolution#1518

Open
tgreenx wants to merge 3 commits into
zonemaster:developfrom
tgreenx:update-cname
Open

Update CNAME resolution#1518
tgreenx wants to merge 3 commits into
zonemaster:developfrom
tgreenx:update-cname

Conversation

@tgreenx
Copy link
Copy Markdown
Contributor

@tgreenx tgreenx commented Apr 7, 2026

Purpose

This PR slightly updates the CNAME resolution of Engine's recursor. See the Changes section below.
Updated test scenarios are defined in zonemaster/zonemaster#1477.

Context

zonemaster/zonemaster#1477

Changes

  • Zonemaster::Engine::Recursor::_resolve_cname() now returns undef when the CNAME resolution fails, along with a new message tag: CNAME_UNRESOLVABLE
  • Update unit tests:
    • Move the content of scenario TOO-LONG-CNAME-CHAIN to a new scenario TOO-MANY-CNAME,
    • Update scenario TOO-LONG-CNAME-CHAIN to check for tag CNAME_CHAIN_TOO_LONG instead
    • Add scenario UNRESOLVABLE-CNAME

How to test this PR

Unit tests are updated and should pass.

- `Zonemaster::Engine::Recursor::_resolve_cname()` now returns undef when the CNAME resolution fails, along with a new message tag: `CNAME_UNRESOLVABLE`
- Update unit tests: move the content of scenario `TOO-LONG-CNAME-CHAIN` to a new scenario `TOO-MANY-CNAME`, and update scenario `TOO-LONG-CNAME-CHAIN` to check for tag `CNAME_CHAIN_TOO_LONG` instead
@tgreenx tgreenx added this to the v2026.1 milestone Apr 7, 2026
@tgreenx tgreenx added V-Patch Versioning: The change gives an update of patch in version. RC-Fixes Release category: Fixes. labels Apr 7, 2026
Copy link
Copy Markdown
Contributor

@marc-vanderwal marc-vanderwal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So far, so good.

Comment thread lib/Zonemaster/Engine/Recursor.pm Outdated
Comment thread t/recursor-A.t Outdated
Co-authored-by: Marc van der Wal <103426270+marc-vanderwal@users.noreply.github.com>
Comment thread lib/Zonemaster/Engine/Recursor.pm
@marc-vanderwal
Copy link
Copy Markdown
Contributor

The CNAME_UNRESOLVABLE tag is output in some cases where the final query for a CNAME chain gives NODATA. That case can happen fairly frequently and should simply be treated like a negative response (i.e. NXDOMAIN), not like a resolution failure (as if we had gotten SERVFAIL).

I’d suggest a different name for that tag. How about CNAME_TO_NODATA?

@matsduf
Copy link
Copy Markdown
Contributor

matsduf commented May 26, 2026

I’d suggest a different name for that tag. How about CNAME_TO_NODATA?

It think that is a good suggestion. Should there be another tag, CNAME_TO_NXDOMAIN?

For me CNAME_UNRESOLVABLE sounds like we cannot resolve the CNAME record.

@marc-vanderwal
Copy link
Copy Markdown
Contributor

Yes, a CNAME_TO_NXDOMAIN might make sense too.

In any case, I don’t think the ERROR level is appropriate for these tags because they do not indicate a problem so severe that the zone is unresolvable.

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

Labels

RC-Fixes Release category: Fixes. V-Patch Versioning: The change gives an update of patch in version.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants