final class PdnsCapabilities (View source)

Maps a PowerDNS Authoritative Server version string to feature capability flags used by the UI to show, hide, or default behaviour appropriately.

The version timeline reflected here is taken from the upstream changelog (docs/changelog/4.4.rst .. 5.1.rst). When the connected version is unknown (empty string, or detection failed) every capability method returns false (strict mode): the UI must hide newer features whose support cannot be confirmed. This is the fail-safe choice - showing options the server then rejects is worse than briefly hiding them while the API is unreachable.

Views are the exception: they also depend on two runtime settings read from the API, and there an unknown value means "leave the feature visible". See viewsUnavailableReason().

Constants

VIEWS_NEED_VERSION

Reasons Views and Networks cannot be used.

viewsUnavailableReason()

VIEWS_NEED_LMDB

VIEWS_NEED_SETTING

Methods

fromVersion(string|null $version)

Build a capability set from a raw version string. Strips any non-numeric prefix (PowerDNS sometimes prefixes the build with text like "git-").

fromServerInfo(array|null $info)

Build a capability set from the session-cached server info, which may carry the launch and views settings alongside the version. Missing or empty entries are treated as "not read", not as "not supported".

string
version()

No description

bool
isKnown()

No description

bool
isAtLeast(string $minVersion, bool $whenUnknown = false)

True when the connected server is at least $minVersion. When the version is unknown, returns $whenUnknown (default false - conservative).

bool
prefersPrimarySecondaryTerminology()

Primary/Secondary aliases were added in 4.5; older servers only know Master/Slave.

bool
supportsCatalogZones()

Catalog zones (Producer/Consumer kinds) introduced in 4.7.

bool
supportsViews()

Per-zone/network Views introduced in 5.0, and only on LMDB with views=yes.

string|null
viewsUnavailableReason()

Which Views prerequisite the connected server fails, or null when it meets all of them.

string|null
viewsUnavailableMessage()

The reason from viewsUnavailableReason() as a sentence for the UI.

bool
supportsRecordType(string $type)

Whether the connected server understands the given DNS record type.

bool
supportsIndividualRrsetFetch()

Filtering a zone read down to one RRset (rrset_name/rrset_type) added in 4.7.

bool
supportsAutoprimariesApi()

Autoprimary management via API added in 4.6.

bool
supportsRecordTimestamps()

Per-record last-modified timestamps in API responses added in 4.9.

bool
supportsDefaultCsk()

PowerDNS 4.0+ uses CSK (Combined Signing Key) by default. Older servers default to KSK+ZSK and the UI should reflect that.

bool
supportsPemKeyImportExport()

PEM import/export of DNSSEC keys added in 4.7.

bool
supportsRfc9615Bootstrap()

RFC 9615 authenticated DNSSEC bootstrapping added in 5.0.

bool
supportsMetadataKind(string|null $minVersion)

Whether a metadata kind whose minimum version is $minVersion should be shown for the connected server. A null/empty minimum means the kind has always been supported. When the connected version is unknown the kind is hidden (strict mode) so admins don't get options the server may reject.

Details

static PdnsCapabilities fromVersion(string|null $version)

Build a capability set from a raw version string. Strips any non-numeric prefix (PowerDNS sometimes prefixes the build with text like "git-").

A null or empty version yields an "unknown" capability set.

Parameters

string|null $version

Return Value

PdnsCapabilities

static PdnsCapabilities fromServerInfo(array|null $info)

Build a capability set from the session-cached server info, which may carry the launch and views settings alongside the version. Missing or empty entries are treated as "not read", not as "not supported".

Parameters

array|null $info

Return Value

PdnsCapabilities

string version()

No description

Return Value

string

bool isKnown()

No description

Return Value

bool

bool isAtLeast(string $minVersion, bool $whenUnknown = false)

True when the connected server is at least $minVersion. When the version is unknown, returns $whenUnknown (default false - conservative).

Parameters

string $minVersion
bool $whenUnknown

Return Value

bool

bool prefersPrimarySecondaryTerminology()

Primary/Secondary aliases were added in 4.5; older servers only know Master/Slave.

Return Value

bool

bool supportsCatalogZones()

Catalog zones (Producer/Consumer kinds) introduced in 4.7.

Return Value

bool

bool supportsViews()

Per-zone/network Views introduced in 5.0, and only on LMDB with views=yes.

Return Value

bool

string|null viewsUnavailableReason()

Which Views prerequisite the connected server fails, or null when it meets all of them.

Unlike every other gate here, an unread setting counts as passing. The two settings come from an extra API call that a restrictive proxy can block, and hiding Views from an installation where they demonstrably work is a worse failure than the status quo of showing them and letting PowerDNS refuse. Only a value we actually read closes the gate.

Return Value

string|null

string|null viewsUnavailableMessage()

The reason from viewsUnavailableReason() as a sentence for the UI.

Return Value

string|null

bool supportsRecordType(string $type)

Whether the connected server understands the given DNS record type.

Only types whose support actually changed across recent versions are gated here; common types (A, AAAA, MX, etc.) are assumed always supported and return true.

Parameters

string $type

Return Value

bool

bool supportsIndividualRrsetFetch()

Filtering a zone read down to one RRset (rrset_name/rrset_type) added in 4.7.

Return Value

bool

bool supportsAutoprimariesApi()

Autoprimary management via API added in 4.6.

Return Value

bool

bool supportsRecordTimestamps()

Per-record last-modified timestamps in API responses added in 4.9.

Return Value

bool

bool supportsDefaultCsk()

PowerDNS 4.0+ uses CSK (Combined Signing Key) by default. Older servers default to KSK+ZSK and the UI should reflect that.

Return Value

bool

bool supportsPemKeyImportExport()

PEM import/export of DNSSEC keys added in 4.7.

Return Value

bool

bool supportsRfc9615Bootstrap()

RFC 9615 authenticated DNSSEC bootstrapping added in 5.0.

Return Value

bool

bool supportsMetadataKind(string|null $minVersion)

Whether a metadata kind whose minimum version is $minVersion should be shown for the connected server. A null/empty minimum means the kind has always been supported. When the connected version is unknown the kind is hidden (strict mode) so admins don't get options the server may reject.

Parameters

string|null $minVersion

Return Value

bool