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):
- 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.
- 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.\"."
- 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
- 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
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):
Anything else we need to know?:
...
Environment:
external-dns --version):v20260406-v0.21.0awsChecklist
or have checked the staging image to confirm the bug is still reproducible
kubectl get <resource> -o yamloutput includingstatus