interface RecordLookupInterface (View source)

Single-record reads and existence checks within a zone.

Methods

array|null
getRecordById(int|string $recordId)

Get a record by ID

array|null
getRecordFromId(int|string $id)

Get a Record from a Record ID

array
getRecordDetailsFromRecordId(int|string $rid)

Get record details from Record ID

int
getZoneIdFromRecordId(int|string $rid)

Get Zone ID from Record ID

int
recidToDomid(int|string $id)

Record ID to Domain ID

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

Check if a record with the given parameters already exists

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

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

array
getRecordsAtOrUnder(int $domainId, string $name)

Get the enabled records in a zone at a name or anywhere below it, matched case-insensitively. Empty non-terminals are excluded.

bool
hasPtrRecord(int $domain_id, string $name)

Check if any PTR record exists for a given reverse domain name

bool
hasSimilarRecords(int $domain_id, string $name, string $type, int|string $record_id)

Check if record has similar records with same name and type

bool
hasNonDelegationRecords(string $name)

Check if non-delegation records exist for a given name

Details

array|null getRecordById(int|string $recordId)

Get a record by ID

Parameters

int|string $recordId

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

Return Value

array|null

Record data if found, null otherwise

array|null getRecordFromId(int|string $id)

Get a Record from a Record ID

Retrieve all fields of the record and send it back to the function caller.

Parameters

int|string $id

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

Return Value

array|null

array of record detail, or null if nothing found

array getRecordDetailsFromRecordId(int|string $rid)

Get record details from Record ID

Parameters

int|string $rid

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

Return Value

array

array of record details [rid,zid,name,type,content,ttl,prio]

int getZoneIdFromRecordId(int|string $rid)

Get Zone ID from Record ID

Parameters

int|string $rid

Record ID

Return Value

int

Zone ID

int recidToDomid(int|string $id)

Record ID to Domain ID

Gets the id of the domain by a given record id

Parameters

int|string $id

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

Return Value

int

Domain ID of record

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

Check if a record with the given parameters already exists

Parameters

int $domain_id

Domain ID

string $name

Record name

string $type

Record type

string $content

Record content

Return Value

bool

True if record exists, false otherwise

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

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

Prefer this over getRecordsByDomainId() whenever only one name matters: in API backend mode the zone-wide call fetches every record in the zone. 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 records

array getRecordsAtOrUnder(int $domainId, string $name)

Get the enabled records in a zone at a name or anywhere below it, matched case-insensitively. Empty non-terminals are excluded.

Parameters

int $domainId

Domain ID

string $name

Name without a trailing dot

Return Value

array

Records ordered by name and type

bool hasPtrRecord(int $domain_id, string $name)

Check if any PTR record exists for a given reverse domain name

Parameters

int $domain_id

Domain ID

string $name

Reverse domain name (e.g., "1.1.168.192.in-addr.arpa")

Return Value

bool

True if any PTR record exists for this name

bool hasSimilarRecords(int $domain_id, string $name, string $type, int|string $record_id)

Check if record has similar records with same name and type

Parameters

int $domain_id

Domain ID

string $name

Record name

string $type

Record type

int|string $record_id

Current record ID to exclude from check

Return Value

bool

True if similar records found, false otherwise

bool hasNonDelegationRecords(string $name)

Check if non-delegation records exist for a given name

Per RFC 1034: Delegation NS records are NOT authoritative data. Per RFC 4034: DS records are part of the delegation for DNSSEC. This method checks for records other than NS/DS which indicate authoritative data. Only delegation records (NS, DS) at a name should not prevent zone creation.

Parameters

string $name

Record name

Return Value

bool

True if non-delegation records exist, false otherwise