Skip to content

SRV records cannot be created using DNSEndpoint CRD #6357

@alexbakker-quandago

Description

@alexbakker-quandago

What happened:

SRV records cannot be created through the DNSEndpoint CRD, because of an inconsistency in validation of trailing dots in targets. When specifying a target with a trailing dot, external-dns will complain about the fact that the target has a trailing dot, telling you to remove it. If you then remove the trailing dot from the target, external-dns will complain that the target is missing a trailing dot, telling you to add it.

What you expected to happen:

My SRV record to be created.

How to reproduce it (as minimally and precisely as possible):

  1. Create an SRV record with targets containing a trailing dot:
apiVersion: externaldns.k8s.io/v1alpha1
kind: DNSEndpoint
metadata:
  name: example-domains
  namespace: example
spec:
  endpoints:
  - dnsName: _sips._tcp.sip.example.com
    recordTTL: 180
    recordType: SRV
    targets:
     - 1 100 5061 sips1.example.com.
  1. Watch external-dns write the following to the log:
level=warning msg="Endpoint example/example-domains with DNSName _sips._tcp.sip.example.com has an illegal target \"1 100 5061 sips1.example.com.\" for SRV record — use \"1 100 5061 sips1.example.com\" not \"1 100 5061 sips1.example.com.\"."
  1. Remove the trailing dot from the target:
apiVersion: externaldns.k8s.io/v1alpha1
kind: DNSEndpoint
metadata:
  name: example-domains
  namespace: example
spec:
  endpoints:
  - dnsName: _sips._tcp.sip.example.com
    recordTTL: 180
    recordType: SRV
    targets:
     - 1 100 5061 sips1.example.com
  1. Watch external-dns write the following to the log:
level=debug msg="Invalid SRV record target: 1 100 5061 sips1.example.com. Target host does not end with a dot.'"
level=warning msg="Skipping endpoint [:_sips._tcp.sip.example.com] due to invalid configuration [SRV:1 100 5061 sips1.example.com]"

Anything else we need to know?:

...

Environment:

  • External-DNS version (use external-dns --version): v20260406-v0.21.0
  • DNS provider: aws

Checklist

  • I have searched existing issues and tried to find a fix myself
  • I am using the latest release,
    or have checked the staging image to confirm the bug is still reproducible
  • I have provided the actual process flags (not Helm values)
  • I have provided kubectl get <resource> -o yaml output including status
  • I have provided full external-dns debug logs
  • I have described what DNS records exist and what I expected

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions