interface ZoneReadBackendInterface (View source)

Zone lookups, listings, record counts and SOA health read from the DNS backend.

Methods

bool
zoneExists(string $zoneName)

Check if a zone exists by name.

array|null
getZoneById(int $domainId)

Get zone info by ID.

string|null
getZoneNameById(int $domainId)

Get zone name by domain ID.

int|null
getZoneIdByName(string $zoneName)

Get zone ID by name.

string
getZoneTypeById(int $domainId)

Get zone type by domain ID.

string|null
getZoneMasterById(int $domainId)

Get zone master by domain ID, for any zone kind.

int
getBestMatchingReverseZoneId(string $reverseName)

Find the best matching reverse zone ID for a PTR record name.

array
getZones(bool $withDnssec = true)

Get all zones from the DNS backend.

array
getZonesByIds(array $domainIds)

Get id, name and type for the given zone ids, sorted by name.

int
countZones()

Count all zones in the DNS backend.

int|null
countRecords()

Count all record rows in the DNS backend, ENTs included.

int
countZoneRecords(int $domainId)

Count non-ENT records in a zone.

array
getZoneStats(bool $withDnssec = true)

Get bulk zone stats (DNSSEC state, SOA serials) keyed by zone name.

array|null
getZoneSoaHealth(string $zoneName, string $kind)

Report SOA-record presence and disabled state for a zone, used by zone-list UIs to render "Disabled" / "No SOA" badges. SLAVE zones legitimately have no SOA (records arrive via AXFR), so callers may pass the zone kind to skip unnecessary lookups; implementations must return is_missing_soa=false for SLAVE.

Details

bool zoneExists(string $zoneName)

Check if a zone exists by name.

Parameters

string $zoneName

Zone name

Return Value

bool

array|null getZoneById(int $domainId)

Get zone info by ID.

Parameters

int $domainId

Domain ID

Return Value

array|null

[id, name, type, master, dnssec] or null

string|null getZoneNameById(int $domainId)

Get zone name by domain ID.

Parameters

int $domainId

Domain ID

Return Value

string|null

Zone name or null

int|null getZoneIdByName(string $zoneName)

Get zone ID by name.

Parameters

string $zoneName

Zone name

Return Value

int|null

Domain ID or null

string getZoneTypeById(int $domainId)

Get zone type by domain ID.

Parameters

int $domainId

Domain ID

Return Value

string

One of the ZoneKind values (NATIVE, MASTER, SLAVE, PRODUCER, CONSUMER); NATIVE when unknown

string|null getZoneMasterById(int $domainId)

Get zone master by domain ID, for any zone kind.

Parameters

int $domainId

Domain ID

Return Value

string|null

Master IP or null if none is stored

int getBestMatchingReverseZoneId(string $reverseName)

Find the best matching reverse zone ID for a PTR record name.

Parameters

string $reverseName

Reverse name (e.g. 1.168.192.in-addr.arpa)

Return Value

int

Zone ID or -1 if not found

array getZones(bool $withDnssec = true)

Get all zones from the DNS backend.

Returns raw zone data without Poweradmin metadata (ownership, comments). Each zone array contains: name, type, dnssec (bool), master (string).

Parameters

bool $withDnssec

Set false to skip DNSSEC state; API backends then avoid a per-zone lookup and report dnssec as false

Return Value

array

Array of zone data arrays

array getZonesByIds(array $domainIds)

Get id, name and type for the given zone ids, sorted by name.

Unknown ids are skipped.

Parameters

array $domainIds

Domain IDs

Return Value

array

int countZones()

Count all zones in the DNS backend.

Return Value

int

Zone count

int|null countRecords()

Count all record rows in the DNS backend, ENTs included.

Return Value

int|null

Record count, or null when the backend has no global count (API)

int countZoneRecords(int $domainId)

Count non-ENT records in a zone.

Parameters

int $domainId

Domain ID

Return Value

int

Record count

array getZoneStats(bool $withDnssec = true)

Get bulk zone stats (DNSSEC state, SOA serials) keyed by zone name.

SQL backends may return an empty array when this data is not needed; API backends fetch it in a single call to avoid N+1 lookups in zone lists. Record counts are not included - the PowerDNS zone list carries none.

Parameters

bool $withDnssec

Set false when neither the DNSSEC flag nor edited_serial is needed

Return Value

array

array|null getZoneSoaHealth(string $zoneName, string $kind)

Report SOA-record presence and disabled state for a zone, used by zone-list UIs to render "Disabled" / "No SOA" badges. SLAVE zones legitimately have no SOA (records arrive via AXFR), so callers may pass the zone kind to skip unnecessary lookups; implementations must return is_missing_soa=false for SLAVE.

Returns null on transient backend failure so callers can preserve any previously-cached state instead of overwriting it with an inferred default.

Parameters

string $zoneName

Zone name (without trailing dot)

string $kind

Zone kind ('MASTER', 'NATIVE', 'SLAVE', 'PRODUCER', 'CONSUMER')

Return Value

array|null