class ZoneValidationService (View source)

Zone Validation Service

Validates zone records for common issues that could cause DNSSEC signing to fail. Performs comprehensive pre-flight checks before DNSSEC operations.

Methods

__construct(RecordRepositoryInterface $recordRepository)

No description

array
validateZoneForDnssec(int $zoneId, string $zoneName)

Validate zone records before DNSSEC signing

string
getFormattedErrorMessage(array $validationResult)

Get a formatted error message from validation results

Details

__construct(RecordRepositoryInterface $recordRepository)

No description

Parameters

RecordRepositoryInterface $recordRepository

array validateZoneForDnssec(int $zoneId, string $zoneName)

Validate zone records before DNSSEC signing

Performs pre-flight checks:

  • SOA record validation (must exist and be valid)
  • NS record validation (at least one NS record required at zone apex)

Note: We only validate critical requirements for DNSSEC signing. Other checks (TXT quoting, duplicates, TTL consistency) are omitted as they don't prevent DNSSEC signing from succeeding.

Delegation NS records (e.g., child.example.com NS ...) are not counted as they represent subdomain delegations, not zone authority.

Parameters

int $zoneId

Zone ID to validate

string $zoneName

Zone name (FQDN)

Return Value

array

Array with 'valid' boolean and 'issues' array of problem descriptions

string getFormattedErrorMessage(array $validationResult)

Get a formatted error message from validation results

Parameters

array $validationResult

Result from validateZoneForDnssec()

Return Value

string

Formatted error message for display