DNS records

TAK-OS DNS combines static configuration, Kubernetes-generated records and direct peer imports into an authoritative serving view. Records remain owned by their source and zone. Nothing in the DNS serving path recurses, forwards a query or queries a public resolver.

For console procedures, see using the console. For flags, negative responses, wildcards, referrals and transport behaviour, see DNS behaviour. Record validation is implemented in the model, generation in Kubernetes snapshots, and serving/merging in the cache.

Static record shape and owners

In Kubernetes, entries belong to DNSRecords spec.records. Each group can mix absolute owner names and types without a DNSZone. For example:

apiVersion: dns.tak-os.io/v1alpha1
kind: DNSRecords
metadata:
  name: platform-extras
  namespace: tak-os-dns
spec:
  records:
    - {name: www.example.com., type: A, ttl: 60, value: 192.0.2.10}
    - {name: old.example.net., type: DNAME, ttl: 60, value: new.example.net.}

Standalone/file records have the same JSON shape. Legacy file configuration can also put records inside a zone's records array; the relative-name examples below apply only to that nested format:

{"name":"www","type":"A","ttl":300,"value":"192.0.2.10"}

The fields and their defaults are described in configuration. Record type names are case-insensitive. Owners are normalized to lowercase absolute DNS names and a single wire-equivalent escape representation. For example, \097.example. and a.example. identify the same owner. JSON strings require doubled backslashes for DNS escapes. Zone names and domain-name RDATA targets use the same canonicalization. Literal DNS name characters are escaped before constructing DNS text, so an owner such as ;example. remains a literal name rather than becoming a comment. A nil parsed record or a parser result with a different owner/class/type is rejected before publication.

Legacy relative owner examples:

name in zone example.com. Stored owner
@ example.com.
www www.example.com.
api.team api.team.example.com.
api.team.example.com. api.team.example.com.
outside.example.net. Rejected: outside the containing zone.

An owner such as www.example.com without its trailing dot is still relative: it becomes www.example.com.example.com.. Use the trailing dot for an absolute owner. The application assigns the record's zone from its containing zone object and assigns static source ownership; manually supplied zone/source fields cannot override this.

value contains only RDATA, not the owner, class, TTL or RR type. RDATA follows DNS presentation syntax and is parsed without a containing-zone origin. Always write domain-valued RDATA as a fully qualified name with a trailing dot: a target such as mail does not mean mail.example.com.. JSON string escaping is required around embedded quotes and backslashes.

Supported static types

The examples below are record objects intended for a suitable zone's records array. Address examples use documentation-only ranges.

Type value syntax Example object
A IPv4 address {"name":"www","type":"A","ttl":60,"value":"192.0.2.10"}
AAAA IPv6 address {"name":"www","type":"AAAA","ttl":60,"value":"2001:db8::10"}
DNAME Subtree target DNS name {"name":"old","type":"DNAME","ttl":60,"value":"new.example.com."}
CNAME Canonical target DNS name {"name":"alias","type":"CNAME","ttl":60,"value":"www.example.com."}
MX Preference and mail-exchanger DNS name {"name":"@","type":"MX","ttl":300,"value":"10 mail.example.com."}
TXT One or more quoted character strings {"name":"@","type":"TXT","ttl":300,"value":"\"v=spf1 -all\""}
NS Nameserver DNS name {"name":"child","type":"NS","ttl":300,"value":"ns.child.example.com."}
SRV Priority, weight, port and target DNS name {"name":"_https._tcp","type":"SRV","ttl":60,"value":"10 20 443 app.example.com."}
CAA Flags, tag and quoted value {"name":"@","type":"CAA","ttl":300,"value":"0 issue \"letsencrypt.org\""}
PTR Target DNS name, normally in an explicitly configured reverse zone {"name":"10","type":"PTR","ttl":300,"value":"host.example.com."} in 2.0.192.in-addr.arpa.

For SRV, priority, weight and port are RDATA numbers, not extra JSON fields. For CAA, quote the property value inside the RDATA string. TXT preserves text case and content; DNS owner/target canonicalization does not lowercase TXT data. A multi-part TXT value can be written as:

{"name":"verification","type":"TXT","ttl":300,"value":"\"first part\" \"second part\""}

Each TXT character string on the wire has a 255-byte limit. The current DNS text parser automatically splits longer quoted input into character strings within that bound, so a quoted input longer than 255 bytes is not by itself rejected. Normalized RDATA can therefore contain several quoted strings even when input used one. Explicitly split text where the consuming protocol requires particular boundaries. RDATA containing a literal line break is rejected. Every record must parse and pack as DNS wire data, and its calculated wire length must not exceed 60,000 bytes. A combined RRset can still exceed a DNS reply limit; see DNS behaviour.

SOA is generated from zone settings and cannot be entered as a static or imported source record. DNAME is supported; DNSSEC types, NAPTR, TLSA, SVCB and HTTPS are not accepted as static configuration types. Query validation also supports querying SOA, but that does not make it an editable static type.

Generated apex SOA and NS

A zone receives an SOA only when SOA generation is enabled. DNSZone CRs default soa to false; legacy file zones with omitted soa retain generated SOA. Explicit configured ns entries generate apex NS independently. When SOA is false and ns is empty, no synthetic apex data is created. NS names are sorted during configuration normalization; the first is used as SOA MNAME. admin supplies the SOA mailbox name.

SOA component Value
TTL Zone ttl.
MNAME First normalized/sorted zone ns entry.
RNAME Zone admin.
Serial Nonzero, content-derived 32-bit fingerprint of selected zone metadata and source-owned records. Not a chronological counter.
Refresh 30 seconds.
Retry 10 seconds.
Expire 2147483647 seconds; this does not expire peer data from the application.
Minimum Zone ttl, also used with the SOA TTL in negative answers.

Configured static apex NS records merge with generated apex NS entries and share the minimum TTL of that RRset. Nameserver A/AAAA records are not synthesized from the ns list: supply their addresses through static or generated records. Standard BIND zone transfer/expiry behaviour does not apply to TAK peer retention.

When several clusters contribute the same zone, metadata comes from the lexicographically first contributing cluster identity. Coordinate zone settings between clusters; the server does not merge competing SOA administrator/default TTL/NS settings into a new zone definition. Static source NS contributions can still merge as records. The peer protocol uses content fingerprints and source watermarks, independently of SOA serial ordering.

Kubernetes-generated names

Generated sources are read across all namespaces, independently of POD_NAMESPACE. Ingresses require an explicit class mapped to an annotated exposed Service. Static DNSZone/DNSRecords definitions, PeerSites, settings and Secrets are restricted to POD_NAMESPACE.

Kubernetes source Owner Data used
Service <metadata.name>.<metadata.namespace>.<DOMAIN> Only spec.externalIPs.
ExternalIPBinding (tak-os.org/v1) <spec.serviceRef.name>.<metadata.namespace>.<DOMAIN> Only spec.externalIPs; optional operator CRD.
Node with a bare name <metadata.name>.<DOMAIN> Only status.addresses entries whose type is exactly ExternalIP.
Node with a qualified name Existing name, canonicalized with a trailing dot Only ExternalIP entries.
Ingress rule with a mapped spec.ingressClassName Each nonempty spec.rules[].host CNAME to its annotated controller Service's generated name.

For example, Service payments in namespace production, with DOMAIN set to example.com, publishes payments.production.example.com.. Node worker-1 publishes worker-1.example.com.; Node worker-1.region.example.com retains worker-1.region.example.com.. Services do not derive records from ClusterIP, EndpointSlices, endpoints or LoadBalancer status. Nodes never fall back to InternalIP, hostname or other address types. Ingress status/load-balancer addresses and EXTIPS do not supply generated Ingress records. See Kubernetes annotations for controller Service opt-in, class mapping, classless exclusions and ignore rules.

ExternalIPBinding is provided by TAK-OS External IP Operator, not installed by DNS. DNS probes /apis/tak-os.org/v1/externalipbindings on every local refresh, including after a startup without that CRD. A first-page HTTP 404 means the optional API is absent. HTTP 403, other API errors, malformed lists and failed continuation pages reject the entire candidate and retain last-good records. Apply the updated DNS ClusterRole even on clusters without the CRD so permission is ready when it appears.

Bindings publish the referenced Service's name in the binding's namespace, rather than the binding object's name. Multiple bindings for the same Service contribute independently under externalipbinding/<UID>; they also merge with legacy Service externalIPs. The DNS reader uses declared spec.externalIPs, including every address in a shared manifest, unless the binding or its referenced Service has dns.tak-os.org/ignore: "true". A missing referenced Service does not by itself suppress binding address records. There is no filtering by ports, operator status, ready endpoints, matched local interfaces or binding conditions. It reports desired exposure rather than data-plane health. This matches the existing Service generation policy. Removing a binding or changing its addresses removes only that binding's contribution after a successful refresh.

The binding list collection and object resource versions travel with local and peer snapshots. If the CRD is removed entirely, the local refresh treats the API as absent; peers that already accepted its collection watermark retain their previous snapshot until an export again supplies that watermark. Delete binding objects while the API is still available to propagate normal removals before removing the CRD.

Multiple IPv4/IPv6 addresses are supported and identical addresses from one object are deduplicated. Objects without eligible addresses contribute no address records. Empty Ingress hosts are ignored; wildcard hosts such as *.example.com are retained as wildcard owners. Duplicate Ingress hosts do not multiply their contributions. Removing an eligible address/host or deleting an object removes that object's contribution after a successful complete refresh.

Generated names do not require a DNSZone or SOA. The serving view uses the longest matching zone when present, otherwise the unzoned bucket. DOMAIN controls name construction; it does not create a zone. An invalid/incomplete resource collection rejects the candidate local snapshot; it is not interpreted as removal of every record.

Zone ownership, merging and conflicts

Each contribution retains its owning zone, source cluster and static/object source identity. Imported records carry their source zone metadata. A query uses the most specific hosted zone for its name; records from a parent zone are not merged into that child's authoritative data. Parent glue remains available for parent referrals, and parent wildcard/name-existence entries do not suppress or mask child-zone records. See architecture.

Within one owning zone:

  • Same-owner/type contributions merge into a complete RRset. Canonical identical RDATA deduplicates while retaining all contributors' ownership. The minimum contributing TTL applies to every record in the RRset.
  • Multiple address contributors produce DNS round-robin answers: all distinct A/AAAA addresses remain eligible and answer ordering rotates. Normal UDP/TCP response-size rules still apply.
  • Any A or AAAA contribution masks CNAME at that owner for all query types, including CNAME queries. This applies regardless of local/remote origin and regardless of the address family requested. An A-only owner masks its CNAME even for an AAAA query, which therefore returns authoritative NOERROR/NODATA if no AAAA answer is known. A CNAME query at an address-masked owner likewise returns NODATA rather than exposing the masked alias.
  • Masking only removes CNAME from the serving view. Its source definition remains in configuration/import state and local definitions remain eligible for local export. It becomes available again when the last address contribution is explicitly removed.
  • Multiple distinct unmasked CNAME targets, or an unmasked CNAME mixed with other non-address data, cause SERVFAIL at the owner. There is no arrival-order winner. Static conflicts detectable within one configuration are rejected before publication; conflicts arising between independently valid sources are represented in the serving view.

Removing one contributor never removes an identical record retained by another. Peer-learned data is authoritative at the receiving server but is never re-exported as locally owned data. Site identities/endpoints propagate transitively, but DNS records are fetched directly from each origin after its credential is supplied. A chain of peers never re-exports another site’s DNS records.

TTL, refresh, deletion and restart

TTL controls downstream DNS caching. It is not an expiry timer for TAK-OS DNS's authoritative store. Local and imported data remain on a running pod until their source explicitly removes/replaces them. A failed refresh, elapsed TTL or peer outage retains last-good data; failed or partial transfers never publish an empty replacement.

Successful complete snapshots remove contributions omitted by their source. Deleting a configured peer purges that imported source as configuration converges. Deleting a DNSZone removes that object’s metadata, not independent DNSRecords or generated names. Legacy nested file records disappear when their containing zone is removed from the file. Remaining records can use a matching parent zone or the unzoned bucket; independently owned peer data remains. PTR records are explicitly configured and are not generated automatically; a reverse DNSZone is optional for direct cached answers, while public reverse delegation remains an operator responsibility.

Generated records, imported records and transfer journals live only in pod memory. After an all-pod restart, imports are relearned and a brief warming period is expected. Startup readiness requires local synchronization and an initial attempt for every configured peer cluster, rather than successful contact with every peer. See peer administration, troubleshooting and DNS validation.

DNAME and cache misses

A DNAME redirects strict descendants, preserves their prefix and returns the DNAME plus a synthesized CNAME. It does not redirect its own owner. A known local or imported target is followed in cache; an unknown target returns the positive alias chain without recursion. A rewritten name exceeding DNS length limits returns YXDOMAIN. Multiple targets or conflicting delegation produce errors; see DNS behaviour.

A completely unknown owner returns REFUSED, including under a configured SOA. A known owner missing the requested type returns authoritative NOERROR/NODATA. This includes applicable wildcard RR owners and empty non-terminals established within an explicit zone. Inferred ancestors of unzoned records stay unknown; a bare zone with SOA=false, no NS and no establishing RR data does not create a known apex. NODATA includes an SOA only when the selected zone enables one; it works without a DNSZone or SOA. No NXDOMAIN is generated by this serving path.

NODATA is normally terminal for resolver libraries: it does not make them ask a second nameserver for a missing type. This is the selected single-family compatibility policy; configured mesh resolvers should converge on the same owner/type data. Completely unknown names retain REFUSED fallback. See the actual libc results, including musl parallel-server races and TCP error limitations.

Standalone zone-empty contributions preserve independent-answer provenance even when indexed beneath an optional zone. Their positive RRsets and usable aliases can answer below a parent delegation; explicit parent-zone glue still produces referrals and does not become child-authoritative data. CNAME masking happens before this provenance decision. See delegation details.

For an independently known owner below a parent delegation, missing-type NODATA does not attach the parent's SOA. Only an applicable uncut zone can supply SOA authority; independent existence does not promote an existing parent-owned glue RRset into an authoritative answer.