TXTRecordValidator
class TXTRecordValidator implements DnsRecordValidatorInterface (View source)
TXT record validator
Validates TXT records according to:
- RFC 1035: Domain Names - Implementation and Specification
- RFC 7208: Sender Policy Framework (SPF) for Authorizing Use of Domains in Email
- RFC 7489: Domain-based Message Authentication, Reporting, and Conformance (DMARC)
PowerDNS automatically splits TXT records longer than 255 bytes into multiple 255-byte chunks for wire transmission. This validator accepts long TXT records (up to 4096 bytes) and relies on PowerDNS to handle the protocol-level splitting.
Special handling is provided for specialized TXT record formats:
- DMARC records at _dmarc.
with v=DMARC1 content
Constants
| private MAX_ZONE_TEMPLATE_LENGTH |
Maximum length for zone template records (matches zone_templ_records.content VARCHAR(2048)). Regular zone records use PowerDNS records.content VARCHAR(64000) and don't need this limit. |
Methods
Create a validator instance for zone template records Zone templates have a VARCHAR(2048) constraint on the content column
Validates TXT record content
Details
__construct(ConfigurationManager $config, int|null $maxLength = null)
No description
static TXTRecordValidator
forZoneTemplate(ConfigurationManager $config)
Create a validator instance for zone template records Zone templates have a VARCHAR(2048) constraint on the content column
ValidationResult
validate(string $content, string $name, mixed $prio, int|string|null $ttl, int $defaultTTL, mixed ...$args)
Validates TXT record content