interface RecordReadBackendInterface (View source)

Record lookups by id, name or zone read from the DNS backend.

Methods

array|null
getRecordById(int|string $recordId)

Get a single record by ID.

int
getZoneIdFromRecordId(int|string $recordId)

Get zone ID from a record ID.

bool
recordExists(int $domainId, string $name, string $type, string $content)

Check if a record with given attributes exists.

array
getRecordsByZoneId(int $domainId, string|null $type = null)

Get records by zone ID, optionally filtered by type.

array
getRecordsByName(int $domainId, string $name, string|null $type = null)

Get the records at one name in a zone, optionally filtered by type.

array
findRecordsByName(string $name, string|null $type = null)

Find the records at one name across every zone, optionally filtered by type.

array
findRecordsByContent(string $content, string|null $type = null)

Find the records whose content equals the given value across every zone, optionally filtered by type. The API backend answers through the PowerDNS search endpoint, which stops at 10,000 matches; use findAllRecordsByContent() when a missed record would let a check pass.

array|null
findAllRecordsByContent(string $content, string|null $type = null)

findRecordsByContent(), or null when the backend could not see every match.

string
getSOARecord(int $domainId)

Get SOA record content for a zone.

array
getZoneRecords(int $domainId, string $zoneName)

Get all records for a zone from the DNS backend.

Details

array|null getRecordById(int|string $recordId)

Get a single record by ID.

Parameters

int|string $recordId

Record ID (int for SQL mode, encoded string for API mode)

Return Value

array|null

Record data or null

int getZoneIdFromRecordId(int|string $recordId)

Get zone ID from a record ID.

Parameters

int|string $recordId

Record ID (int for SQL mode, encoded string for API mode)

Return Value

int

Zone ID (0 if not found)

bool recordExists(int $domainId, string $name, string $type, string $content)

Check if a record with given attributes exists.

Parameters

int $domainId

Domain ID

string $name

Record name

string $type

Record type

string $content

Record content

Return Value

bool

array getRecordsByZoneId(int $domainId, string|null $type = null)

Get records by zone ID, optionally filtered by type.

Parameters

int $domainId

Domain ID

string|null $type

Optional record type filter

Return Value

array

Array of record data

array getRecordsByName(int $domainId, string $name, string|null $type = null)

Get the records at one name in a zone, optionally filtered by type.

Names match case-insensitively, per RFC 4343.

Parameters

int $domainId

Domain ID

string $name

Record name, with or without a trailing dot

string|null $type

Optional record type filter

Return Value

array

Array of record data

array findRecordsByName(string $name, string|null $type = null)

Find the records at one name across every zone, optionally filtered by type.

Names match case-insensitively. The API backend reads the RRsets of the most specific zone that holds the name.

Parameters

string $name

Record name

string|null $type

Optional record type filter

Return Value

array

Array of record data (id, domain_id, name, type, content, ttl, prio, disabled)

array findRecordsByContent(string $content, string|null $type = null)

Find the records whose content equals the given value across every zone, optionally filtered by type. The API backend answers through the PowerDNS search endpoint, which stops at 10,000 matches; use findAllRecordsByContent() when a missed record would let a check pass.

Parameters

string $content

Record content, exact match

string|null $type

Optional record type filter

Return Value

array

Array of record data (id, domain_id, name, type, content, ttl, prio, disabled)

array|null findAllRecordsByContent(string $content, string|null $type = null)

findRecordsByContent(), or null when the backend could not see every match.

Parameters

string $content

Record content, exact match

string|null $type

Optional record type filter

Return Value

array|null

Array of record data, or null when the lookup may be incomplete

string getSOARecord(int $domainId)

Get SOA record content for a zone.

Parameters

int $domainId

Domain ID

Return Value

string

SOA content or empty string

array getZoneRecords(int $domainId, string $zoneName)

Get all records for a zone from the DNS backend.

Returns a flat array of record data. In SQL mode, records include numeric IDs. In API mode, IDs are resolved from the database. ENT records (null/empty type) are excluded.

Parameters

int $domainId

Domain ID

string $zoneName

Zone name (needed for API calls)

Return Value

array

Array of record data arrays