CNAMERecordValidator
class CNAMERecordValidator implements DnsRecordValidatorInterface (View source)
Validator for CNAME DNS records
Validates CNAME records according to:
- RFC 1034: Domain Names - Concepts and Facilities
- RFC 1035: Domain Names - Implementation and Specification
- RFC 2181: Clarifications to the DNS Specification (Section 10.1)
CNAME records (Canonical Name) create an alias from one domain name to another. According to RFC 1034 and RFC 2181, CNAME record names must be unique, cannot coexist with other record types, and MX/NS records cannot point to a CNAME.
Methods
Constructor
Validate CNAME record
Validate the parts of a CNAME record that do not depend on the zone it lives in.
Check if CNAME already exists
Details
__construct(ConfigurationManager $config, PDO $db, DnsBackendProvider|null $backendProvider = null)
Constructor
ValidationResult
validate(string $content, string $name, mixed $prio, int|string|null $ttl, int $defaultTTL, mixed ...$args)
Validate CNAME record
ValidationResult
validateSyntax(string $content, string $name, mixed $prio, int|string|null $ttl, int $defaultTTL)
Validate the parts of a CNAME record that do not depend on the zone it lives in.
Callers holding a record with no zone context - zone template records, for instance - use this to check the record itself without the existence lookups that only make sense against a real zone.
ValidationResult
validateCnameExistence(string $name, int|string $rid)
Check if CNAME already exists