interface ConsistencyCheckerInterface (View source)

Finds and repairs ownerless zones, masterless slave zones, orphaned records and missing or duplicate SOAs. One implementation per DNS backend.

Every check returns ['status' => 'success'|'warning'|'error', 'message' => string, 'data' => list of findings].

Methods

array
checkZonesHaveOwners()

No description

array
checkZonesHaveCanonicalIds()

No description

array
checkZonesHaveNames()

Zones with owners or grants but no zones row carrying their exact name, which a switch to the API backend would add again without them. Only the SQL backend can have them.

array
checkSharedZoneIds()

Zone ids two zones share, whose extra owners and group grants are therefore ignored.

array
checkGroupGrantsOnRowIds()

Group assignments stored under a zone's row id instead of its canonical id.

array
checkApiKeyScopesNameZones()

API key zone restrictions naming a zone id no zone has, which a zone later given that id would fall under. Only the SQL backend hands out an id again.

array
checkZoneNamesDifferingInCase()

Zone names that exist more than once in different letter case, such as Example.com and example.com, which PowerDNS treats as the same name. Report only.

array
checkRecordNamesInLowercase()

Records whose name holds uppercase letters, which PowerDNS never serves and the record lookups never find. Only the SQL backend can store them.

array
checkSlaveZonesHaveMasters()

No description

array
checkRecordsBelongToZones()

No description

array
checkDuplicateSOARecords()

No description

array
checkZonesWithoutSOA()

No description

array|null
runAllChecks()

Run every check, keyed by check name. Null means the backend could not be read and no result can be trusted.

bool
fixZoneWithoutOwner(int $zoneId, int $currentUserId)

Assign $currentUserId as the owner of a zone that has none.

array
fixAllZonesWithoutOwner(int $currentUserId)

No description

bool
fixZoneCanonicalId(int $zoneId)

Point a stranded zones row's domain_id at its own id; $zoneId is the row's primary key.

array
bool
fixZoneName(int $zoneId)

Give the zone a zones row carrying its PowerDNS name; $zoneId is the domains.id.

array
fixAllZonesWithoutName()

No description

bool
fixApiKeyScopesOnMissingZone(int $zoneId)

Point the API key restrictions on $zoneId, which no zone has, at no zone.

array
bool
fixRecordNameCase(int $recordId)

Lowercase the record's name, and the name of the comments on its RRset.

array
fixAllRecordNamesCase()

No description

bool
deleteSlaveZone(int $zoneId)

No description

bool
deleteOrphanedRecord(int $recordId)

No description

bool
fixDuplicateSOA(int $zoneId)

Keep the first SOA record of the zone and delete the rest.

bool
createDefaultSOA(int $zoneId)

No description

array
fixOne(string $type, int $id, int $currentUserId)

Apply the single-item repair for a consistency page check type (zones_without_owners, zones_without_canonical_ids, records_with_uppercase_names, slave_zones_without_masters, orphaned_records, duplicate_soa, zones_without_soa) to one finding.

array
fixAll(string $type, int $currentUserId)

Apply a check type's bulk repair to every finding; only the two zone checks offer one.

Details

array checkZonesHaveOwners()

No description

Return Value

array

array checkZonesHaveCanonicalIds()

No description

Return Value

array

array checkZonesHaveNames()

Zones with owners or grants but no zones row carrying their exact name, which a switch to the API backend would add again without them. Only the SQL backend can have them.

Return Value

array

array checkSharedZoneIds()

Zone ids two zones share, whose extra owners and group grants are therefore ignored.

Return Value

array

array checkGroupGrantsOnRowIds()

Group assignments stored under a zone's row id instead of its canonical id.

Return Value

array

array checkApiKeyScopesNameZones()

API key zone restrictions naming a zone id no zone has, which a zone later given that id would fall under. Only the SQL backend hands out an id again.

Return Value

array

array checkZoneNamesDifferingInCase()

Zone names that exist more than once in different letter case, such as Example.com and example.com, which PowerDNS treats as the same name. Report only.

Return Value

array

array checkRecordNamesInLowercase()

Records whose name holds uppercase letters, which PowerDNS never serves and the record lookups never find. Only the SQL backend can store them.

Return Value

array

array checkSlaveZonesHaveMasters()

No description

Return Value

array

array checkRecordsBelongToZones()

No description

Return Value

array

array checkDuplicateSOARecords()

No description

Return Value

array

array checkZonesWithoutSOA()

No description

Return Value

array

array|null runAllChecks()

Run every check, keyed by check name. Null means the backend could not be read and no result can be trusted.

Return Value

array|null

bool fixZoneWithoutOwner(int $zoneId, int $currentUserId)

Assign $currentUserId as the owner of a zone that has none.

Parameters

int $zoneId
int $currentUserId

Return Value

bool

array fixAllZonesWithoutOwner(int $currentUserId)

No description

Parameters

int $currentUserId

Return Value

array

bool fixZoneCanonicalId(int $zoneId)

Point a stranded zones row's domain_id at its own id; $zoneId is the row's primary key.

Parameters

int $zoneId

Return Value

bool

array fixAllZonesWithCanonicalIdIssue()

No description

Return Value

array

bool fixZoneName(int $zoneId)

Give the zone a zones row carrying its PowerDNS name; $zoneId is the domains.id.

Parameters

int $zoneId

Return Value

bool

array fixAllZonesWithoutName()

No description

Return Value

array

bool fixApiKeyScopesOnMissingZone(int $zoneId)

Point the API key restrictions on $zoneId, which no zone has, at no zone.

Parameters

int $zoneId

Return Value

bool

array fixAllApiKeyScopesOnMissingZones()

No description

Return Value

array

bool fixRecordNameCase(int $recordId)

Lowercase the record's name, and the name of the comments on its RRset.

Parameters

int $recordId

Return Value

bool

array fixAllRecordNamesCase()

No description

Return Value

array

bool deleteSlaveZone(int $zoneId)

No description

Parameters

int $zoneId

Return Value

bool

bool deleteOrphanedRecord(int $recordId)

No description

Parameters

int $recordId

Return Value

bool

bool fixDuplicateSOA(int $zoneId)

Keep the first SOA record of the zone and delete the rest.

Parameters

int $zoneId

Return Value

bool

bool createDefaultSOA(int $zoneId)

No description

Parameters

int $zoneId

Return Value

bool

array fixOne(string $type, int $id, int $currentUserId)

Apply the single-item repair for a consistency page check type (zones_without_owners, zones_without_canonical_ids, records_with_uppercase_names, slave_zones_without_masters, orphaned_records, duplicate_soa, zones_without_soa) to one finding.

Parameters

string $type
int $id
int $currentUserId

Return Value

array

status is success or error

array fixAll(string $type, int $currentUserId)

Apply a check type's bulk repair to every finding; only the two zone checks offer one.

Parameters

string $type
int $currentUserId

Return Value

array

status is success, warning or error