DNS¶
The public DNS zone is declared in Git and reconciled by ExternalDNS. Every record (web hosts, mail, SRV service discovery, DKIM/DMARC, and the infrastructure names) is a line in a values file, so a DNS change is reviewed and merged like any other change, and nobody edits records by hand in the provider's panel.
How it works¶
values.yaml (dnsRecords)
│ rendered by the chart
▼
DNSEndpoint CR ──► external-dns ──► webhook provider (sidecar) ──► DNS provider API
(crd source, localhost:8888
1-minute loop)
| Piece | Where | Role |
|---|---|---|
applications/external-dns/ |
platform-argocd |
Wrapper chart around the upstream external-dns Helm chart; renders records and the provider token |
dnsRecords |
applications/external-dns/values.yaml |
The zone's records, declared as data |
DNSEndpoint |
namespace external-dns |
One CR holding every record, the only source external-dns reads (sources: [crd]) |
| Webhook sidecar | same pod | Translates external-dns calls into the DNS provider's API |
providerSecret |
same values file | The provider API token, as a SealedSecret |
The wrapper chart is provider- and zone-agnostic. Everything specific to one deployment (the
provider, the domain filter, the records and the sealed token) sits in values.yaml.
Safety settings¶
| Setting | Value | Effect |
|---|---|---|
policy |
upsert-only |
external-dns creates and updates records but never deletes one |
registry |
noop |
No ownership TXT records are written next to each record |
domainFilters |
the base domain | Only that zone is touched |
--managed-record-types |
A AAAA CNAME MX SRV TXT |
external-dns manages only A/AAAA/CNAME by default; every other type must be listed or it is silently skipped |
With upsert-only, records that are not declared in Git are left alone, so hand-managed or
provider-managed entries in the same zone survive. The noop registry fits a zone where
external-dns is the only automated writer. If another controller writes to the same zone, use the
txt registry instead so each instance only changes the records it owns.
Declaring records¶
dnsEndpointName: example-org
defaultTTL: 300 # used by every record without its own recordTTL
dnsRecords:
- { dnsName: example.org, recordType: A, targets: ["203.0.113.10"] }
- { dnsName: example.org, recordType: MX, targets: ["10 mx1.example.org", "10 mx2.example.org"] }
- { dnsName: "*.example.org", recordType: CNAME, targets: ["edge.example.org"] }
- { dnsName: turn.example.org, recordType: A, targets: ["203.0.113.11", "203.0.113.12"], recordTTL: 60 }
- { dnsName: _matrix._tcp.example.org, recordType: SRV, targets: ["1 10 443 matrix.example.org."] }
- { dnsName: _dmarc.example.org, recordType: TXT, targets: ["v=DMARC1; p=quarantine"] }
- One entry per name and type. Several values for the same name (round-robin A, multiple MX)
go in one entry's
targetslist, not in separate entries. - MX carries the preference in the target:
"10 mx1.example.org". - SRV targets are
priority weight port target, with the target as an FQDN ending in a dot. - TXT values are written unquoted, as one string, even when longer than 255 bytes (a 2048-bit DKIM key, for example). The provider handles quoting and chunking.
- Specific names win over a wildcard, so a wildcard CNAME can cover all web hosts while individual names point elsewhere.
Changing and removing records¶
To add or change a record, edit dnsRecords and merge the change. ArgoCD syncs the
DNSEndpoint, and external-dns applies it on its next loop (within a minute).
To remove a record, delete its entry from dnsRecords and delete the record at the
provider. Under upsert-only, removing an entry stops external-dns from managing the record but
does not delete it. Renaming a record works the same way: the new name is created, and the old one
stays until it is deleted at the provider.
Lower the TTL before a planned move
Before repointing an important name (or moving the zone to another provider), lower its
recordTTL first and wait out the old TTL. Resolvers then pick up the change, or a rollback,
quickly.
Provider: Infomaniak webhook¶
The zone is hosted at Infomaniak, which external-dns reaches through the external-dns-webhook-infomaniak provider, running as a sidecar in the external-dns pod.
- API token scopes:
domain:read,dns:read,dns:write. The token is sealed with the platform Sealed Secrets controller into theexternal-dnsnamespace (strict scope) and committed asproviderSecret.encryptedData. See Sealed Secrets. - Minimum TTL is 60 seconds. Lower values are raised to 60 by the provider.
- Network policy: the
external-dnsnamespace is default-deny. Egress is open only to the Kubernetes API and to TCP 443 for the provider API. - Image updates come in as Renovate PRs, like every other pinned image.
Using another provider¶
The chart works with any external-dns provider: an in-tree one (Cloudflare, Route 53, …) or
another webhook. Replace the provider block in values.yaml, seal that provider's credentials
into providerSecret, and adjust domainFilters and dnsRecords for your zone.
If you manage DNS outside the cluster, set global.components.externalDns.enabled: false in
values/global.yaml. Also remove external-dns from the platform sealed-secrets controller's
additionalNamespaces, because that namespace is then not created.
Internal names and split horizon¶
Internal names (the Kubernetes API endpoint, the *.apps.int.<domain> admin-portal
wildcard and the per-node LAN names) are not in the public zone. They point at private LAN
addresses, so they are served only by the edge firewall's resolver (Unbound), which the LAN, the
admin VPN and the cluster nodes use. They are declared as Unbound host overrides in
edge-ansible, not in dnsRecords. This keeps the internal addressing out of public DNS, and
internal names keep resolving when the uplink or the DNS provider is unavailable.
Publishing internal names in the public zone would not help clients behind such a resolver anyway. A resolver with DNS-rebinding protection, such as the edge Unbound, strips private addresses from public answers, so those names come back empty.
A wildcard covers an empty subtree
If the public zone has a wildcard such as *.<domain> and no record exists at or below
int.<domain>, the wildcard answers for every internal name: api.int.<domain> publicly
resolves to the wildcard's target. A wildcard only applies where the name does not exist.
One record at int.<domain> itself (a TXT is enough) makes the name exist, so undeclared
names below it return NXDOMAIN. This deployment declares such a TXT anchor in dnsRecords.
Some public names need a different answer inside the network, for example the SSO login, which internal clients reach through the internal ingress. These overrides live on the same resolver. See Edge firewall.
Certificates¶
Public certificates are issued by cert-manager over the ACME HTTP-01 challenge, so
cert-manager needs no DNS API access, and the DNS token is held only by external-dns. A name
must therefore resolve publicly to the edge before its certificate can be issued. Add the record
(or rely on the wildcard CNAME) before adding the name to a Certificate. Wildcard certificates
would require DNS-01 and are not used.
DNSSEC¶
The zone is DNSSEC-signed by the provider, so records written by external-dns are signed automatically and need no configuration on the cluster side.
Changing DNS provider on a signed zone
The DS record at the parent zone must always match the signing key of the provider that serves the zone. If you move the zone with a stale DS in place, every validating resolver rejects the whole zone: a full outage, not a partial one. Either remove the DS and wait out its TTL before you move, or coordinate the key handover with both providers.
Verifying¶
# external-dns: in steady state every loop logs "All records are already up to date"
kubectl -n external-dns logs deploy/external-dns -c external-dns --tail=20
# the webhook sidecar
kubectl -n external-dns logs deploy/external-dns -c webhook --tail=20
# what the world sees
dig +short example.org MX @1.1.1.1
delv example.org SOA # DNSSEC: "; fully validated"
If unchanged records produce Updated record lines on every loop, the provider is returning the
records in a different form than declared: a missing trailing dot on an SRV target, a quoted or
chunked TXT value, or one row per target. Each loop then rewrites the same records. Check the
entry against the formats in Declaring records.
See also: Sealed Secrets · Edge firewall · What you must change.