MXRecordValidator
class MXRecordValidator implements DnsRecordValidatorInterface (View source)
MX Record Validator
Validates MX (Mail Exchange) records according to:
- RFC 1035: Domain Names - Implementation and Specification (Section 3.3.9)
- RFC 2181: Clarifications to the DNS Specification (Section 10.3)
- RFC 7505: A Method for Indicating Mail Box Unavailability ("null MX")
MX records specify the mail servers responsible for accepting email for a domain. RFC 1035 establishes the basic format of MX records with a 16-bit priority value and a domain name. RFC 2181 clarifies that MX targets cannot point to a CNAME. RFC 7505 defines the "null MX" record (priority 0, target ".") to indicate that a domain does not accept email.
Implementation notes:
- Priority values are from 0 to 65535, with lower values indicating higher priority
- Standard MX records should point to a valid hostname with A/AAAA records
- "Null MX" records use "." as the target with priority 0 to indicate no mail service
- Domains with a null MX record should not have any other MX records
- MX targets should never point to CNAME records (RFC 2181)
Methods
validate(string $content, string $name, mixed $prio, int|string|null $ttl, int $defaultTTL, mixed ...$args)
Validate MX record
Details
__construct(ConfigurationManager $config)
No description
ValidationResult
validate(string $content, string $name, mixed $prio, int|string|null $ttl, int $defaultTTL, mixed ...$args)
Validate MX record