ZoneReadBackendInterface
interface ZoneReadBackendInterface (View source)
Zone lookups, listings, record counts and SOA health read from the DNS backend.
Methods
Check if a zone exists by name.
Get zone info by ID.
Get zone name by domain ID.
Get zone ID by name.
Get zone type by domain ID.
Get zone master by domain ID, for any zone kind.
Find the best matching reverse zone ID for a PTR record name.
Get all zones from the DNS backend.
Get id, name and type for the given zone ids, sorted by name.
Count all zones in the DNS backend.
Count all record rows in the DNS backend, ENTs included.
Count non-ENT records in a zone.
Get bulk zone stats (DNSSEC state, SOA serials) keyed by zone name.
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.
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.
Returns raw zone data without Poweradmin metadata (ownership, comments). Each zone array contains: name, type, dnssec (bool), master (string).
array
getZonesByIds(array $domainIds)
Get id, name and type for the given zone ids, sorted by name.
Unknown ids are skipped.
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.
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.
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.