Skip to content

CNAME targets stored as relative names when the trailing dot is missing #73

Description

@stijzermans

What happened?

External DNS normalizes targets by stripping the trailing dot (endpoint.NewEndpoint), so a target such as website.stackit.com. arrives at the webhook as website.stackit.com.

When trying to add the record website.not-stackit.com with a CNAME to website.stackit.com, STACKIT interprets a target (as sent through the webhook) without a trailing dot as relative to the zone, so the final record becomes: website.stackit.com.not-stackit.com. if DNS zone is not-stackit.com.

Other external-dns providers (Google) avoid this by ensuring hostname-valued targets end in a trailing dot. Relevant now that upstream external-dns explicitly accepts CNAME targets with a trailing dot: external-dns#6218.

How can we reproduce this?

Create an ingress with the following annotations:

external-dns.alpha.kubernetes.io/hostname: website.non-stackit.com
external-dns.alpha.kubernetes.io/target: website.stackit.com

This will create a CNAME for website.non-stackit.com with targetwebsite.stackit.com.non-stackit.com (on a DNS zone for non-stackit.com)
Expect it to be target website.stackit.com

Search

  • I did search for other open and closed issues before opening this.

Code of Conduct

  • I agree to follow this project's Code of Conduct

Additional context

No response

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions