Skip to content

fix: correct SRV record creation and RFC 2782 trailing dot handling#31

Merged
nicholaskuechler merged 1 commit intomainfrom
fix/srv-record-creation
Apr 29, 2026
Merged

fix: correct SRV record creation and RFC 2782 trailing dot handling#31
nicholaskuechler merged 1 commit intomainfrom
fix/srv-record-creation

Conversation

@dusto
Copy link
Copy Markdown
Contributor

@dusto dusto commented Apr 29, 2026

SRV records were created with the record's own DNS name as the target instead of the actual host from the endpoint target string. This caused all SRV records to point at themselves rather than the intended hosts.

Additionally, Rackspace stores SRV target hosts without trailing dots, but external-dns >= 0.21 requires RFC 2782 compliant absolute FQDNs (trailing dot). Add trailing dot normalization in both the read path (convertRecordToEndpoint) and adjustEndpoints so current and desired records match consistently.

external-dns compatibility notes:

Changes:

  • Use parts[3] instead of fqdn when building SRV data for Rackspace API
  • Strip trailing dot before sending to Rackspace (it doesn't use them)
  • Append trailing dot to SRV targets returned by Records()
  • Append trailing dot to SRV targets in adjustEndpoints as safety net
  • Improve SRV test to use distinct target host and validate request body

SRV records were created with the record's own DNS name as the target
instead of the actual host from the endpoint target string. This caused
all SRV records to point at themselves rather than the intended hosts.

Additionally, Rackspace stores SRV target hosts without trailing dots,
but external-dns >= 0.21 requires RFC 2782 compliant absolute FQDNs
(trailing dot). Add trailing dot normalization in both the read path
(convertRecordToEndpoint) and adjustEndpoints so current and desired
records match consistently.

external-dns compatibility notes:

- Versions prior to 0.21 (including 0.18 and 0.20) do not include SRV
  in the TXT registry's getSupportedTypes(), which prevents the registry
  from matching srv- prefixed TXT ownership records to their SRV data
  records. This causes all SRV records to appear unowned and external-dns
  will not update or delete them. Upgrading to >= 0.21 is required.

- CRD-sourced SRV records are broken in external-dns v0.21.0 due to
  contradictory validation in the CRD source and ValidateSRVRecord.
  See kubernetes-sigs/external-dns#6357 and
  the fix in kubernetes-sigs/external-dns#6383.
  A patched external-dns build is required until that PR is merged.

Changes:
- Use parts[3] instead of fqdn when building SRV data for Rackspace API
- Strip trailing dot before sending to Rackspace (it doesn't use them)
- Append trailing dot to SRV targets returned by Records()
- Append trailing dot to SRV targets in adjustEndpoints as safety net
- Improve SRV test to use distinct target host and validate request body
@nicholaskuechler nicholaskuechler merged commit 3af0375 into main Apr 29, 2026
5 checks passed
@nicholaskuechler nicholaskuechler deleted the fix/srv-record-creation branch April 29, 2026 22:02
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