Skip to content

fix: CNAME resolution when External DNS strips trailing dots#77

Open
lukasmetzner wants to merge 2 commits intomainfrom
fix-cname-record
Open

fix: CNAME resolution when External DNS strips trailing dots#77
lukasmetzner wants to merge 2 commits intomainfrom
fix-cname-record

Conversation

@lukasmetzner
Copy link
Copy Markdown
Contributor

@lukasmetzner lukasmetzner commented Jan 22, 2026

External DNS normalizes CNAME targets by removing the trailing dot, which causes CNAME records pointing to a different domain to resolve incorrectly (e.g. foo.mytarget.com.myzone.com).

External DNS is normalizing CNAMES in multiple locations of their code:

For this reason, other providers implement a check to ensure the trailing dot is present according to the needs of their DNS system:

The exact reasoning for this normalization is not documented by External DNS.

Fixes #73

External DNS normalizes CNAME targets by removing the trailing dot,
which causes CNAME records pointing to a different domain to resolve
incorrectly (e.g. `foo.mytarget.com.myzone.com`).

Fixes #73
@lukasmetzner lukasmetzner requested a review from a team as a code owner January 22, 2026 09:28
@codecov
Copy link
Copy Markdown

codecov bot commented Jan 22, 2026

Codecov Report

❌ Patch coverage is 82.60870% with 4 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
internal/provider/provider.go 50.00% 2 Missing and 2 partials ⚠️

📢 Thoughts on this report? Let us know!

@jooola
Copy link
Copy Markdown
Member

jooola commented Jan 22, 2026

Could you add links about your findings in the description please? And why this is not a bug in external dns?

@lukasmetzner
Copy link
Copy Markdown
Contributor Author

Could you add links about your findings in the description please? And why this is not a bug in external dns?

I updated the description. Not sure if this explanation is sufficient.

@lukasmetzner
Copy link
Copy Markdown
Contributor Author

Decision: We will ask at external-dns why this behavior is necessary and if this could be documented.

@jooola
Copy link
Copy Markdown
Member

jooola commented Apr 9, 2026

There was a patch to external-dns that allowed trailing dots: kubernetes-sigs/external-dns#6218 https://github.com/kubernetes-sigs/external-dns/releases/tag/v0.21.0

So we can probably move forward, and think again if we really want to implement this PR.

@lukasmetzner
Copy link
Copy Markdown
Contributor Author

There was a patch to external-dns that allowed trailing dots: kubernetes-sigs/external-dns#6218 https://github.com/kubernetes-sigs/external-dns/releases/tag/v0.21.0

So we can probably move forward, and think again if we really want to implement this PR.

AFAICT this patch only affects the custom resource definition from external-dns and not the Service or Ingress objects.

We could still move forward with this, as the CNAME issue our user ran into still exists.

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.

trailing dot removed (tested for CNAMEs)

2 participants