DNSZone

Resource configuration reference · Kind/name · when · dependsOn

apiVersion: net.routerd.net/v1alpha1 · metadata.name

Local A/AAAA records and generated PTR answers served through a DNSForwarder zoneRefs rule. This is not a general authoritative DNS server with arbitrary record types, zone transfers or signing.

Conditions and references

Configuration syntax

This is explanatory notation, not YAML to copy. Unbracketed fields are required within their parent; [ ... ] marks fields that can be omitted, subject to the conditions in the table. <type> is a placeholder, and (a | b) lists alternatives. Optional parents may contain required children. Conditional requirements, exclusions and runtime defaults are described below. Use the linked YAML example for an ordinary configuration.

- apiVersion: net.routerd.net/v1alpha1
  kind: DNSZone
  metadata:
    name: "<name>"
  spec:
    [ dhcpDerived:
        [ leaseFile: <string> ]
        [ sources:
            - <string>
        ]
        [ ttl: <integer> ]
    ]
    [ dnssec:
        [ enabled: <boolean> ]
    ]
    [ records:
        -
          hostname: <string>
          [ ipv4: <string> ]
          [ ipv4From:
              field: <string>
              [ optional: <boolean> ]
              resource: <string>
          ]
          [ ipv6: <string> ]
          [ ipv6From:
              field: <string>
              [ optional: <boolean> ]
              resource: <string>
          ]
          [ ttl: <integer> ]
    ]
    [ ttl: <integer> ]
    zone: <string>

Field meaning and default

Required children of optional objects apply only when their parent is used. Other exact conditions are in the explanation; bracketed alternatives may still require one choice.

YAML Presence Type / constraints Field meaning and default
spec.zone Required string Required zone domain, for example home.example.net. Runtime adds a trailing dot; no default. Use normal lowercase DNS names because the current validator only checks nonempty.
spec.ttl Optional integer; minimum=0 Zone default TTL in seconds; omitted/0 becomes 300. Schema permits nonnegative values. Used by static records without TTL and generated PTR replies.
spec.dnssec Optional object Optional local-answer AD flag settings; no cryptographic signing or validation.
spec.dnssec.enabled Optional boolean Default false; true sets AD even on local negative/NODATA replies without producing signatures.
spec.records Optional array Optional static A/AAAA record list, default empty. A hostname with no addresses is accepted but has no A/AAAA answer.
spec.records[].hostname Conditionally required string Required name without whitespace or comma. Relative names are suffixed with zone; a full name already inside zone stays unchanged. A name outside zone is also suffixed, not served as an external zone. Use *.subdomain for a wildcard.
spec.records[].ipv4 Optional string Optional bare IPv4 address; default none. Can coexist with ipv4From as a fallback retained when the source is unresolved.
spec.records[].ipv4From Optional object Optional common status-value source; explicit resource/field required and validated. First usable value must be IPv4; CIDR input is reduced to its host address. Runtime reads status, not the declared IPv4StaticAddress fallback used by some other consumers.
spec.records[].ipv6 Optional string Optional bare IPv6 address; default none. Can coexist with ipv6From using the same fallback behavior.
spec.records[].ipv6From Optional object Optional common resource/field/optional source; first value must be IPv6. Same reference, CIDR and missing-value rules as ipv4From; optional defaults false.
spec.records[].ttl Optional integer; minimum=0 Record TTL in seconds; omitted/0 inherits zone TTL. Schema nonnegative; does not affect DHCP-derived TTL.
spec.dhcpDerived Optional object Optional DHCP lease-to-record settings. Runtime lease events can update enabled zones; this is not RFC 2136 DDNS.
spec.dhcpDerived.sources Optional array Default empty disables live lease-event import and sticky snapshot import. Any nonempty list enables them; current runtime does not filter by these source strings or validate referenced DHCP resources. All received lease events are offered to each enabled zone.
spec.dhcpDerived.ttl Optional integer; minimum=0 TTL seconds for DHCP-derived forward records; omitted/0 becomes 60, independent of zone TTL. PTR replies use zone TTL.
spec.dhcpDerived.leaseFile Optional string Optional dnsmasq lease-file path read when constructing/reloading the zone. Empty disables this file import; it is separate from live-event source enablement and not a continuously watched file.

Implementation: pkg/api/specs.go · pkg/config/validate_dns.go · pkg/config/diagnostics.go · pkg/controller/dnsresolver/controller.go · cmd/routerd-dns-resolver/zone.go

Referenceable status fields

The ordinary status-reference validator accepts these field names for this kind. This allowlist does not guarantee that every field is currently populated; inspect runtime status. These are outputs, not YAML spec fields.

phase, zone, records, pendingRecords

Example