URIRecordValidator
class URIRecordValidator implements DnsRecordValidatorInterface (View source)
URI (Uniform Resource Identifier) Record Validator
Validates URI DNS records according to RFC 7553 (The URI DNS Resource Record).
URI records provide a way to publish URIs in the DNS system to identify services and resources associated with a domain name. The URI record can contain any URI that conforms to the URI syntax specified in RFC 3986.
Format:
Components:
- Priority: 16-bit unsigned integer (0-65535) - Lower values have higher priority
- Weight: 16-bit unsigned integer (0-65535) - Used for load balancing among records of equal priority
- Target URI: Quoted string containing a URI that follows RFC 3986 format
URI Scheme Requirements:
- Must start with a letter followed by letters, digits, plus, period, or hyphen
- Standard protocols (http, https, ftp, etc.) require "://" after the scheme
- Special protocols (mailto, tel, sms, etc.) don't require the "//" separator
- The URI can contain any valid characters allowed by RFC 3986
Security Considerations:
- URI records should be used with DNSSEC to prevent manipulation
- Care should be taken when resolving URIs from untrusted DNS sources
- Applications should validate URIs before using them
Common Uses:
- Web service discovery
- Email service configuration
- Application-specific resource location
Methods
validate(string $content, string $name, mixed $prio, int|string|null $ttl, int $defaultTTL, mixed ...$args)
Validates URI record content according to RFC 7553 and RFC 3986
Details
__construct(ConfigurationManager $config)
No description
ValidationResult
validate(string $content, string $name, mixed $prio, int|string|null $ttl, int $defaultTTL, mixed ...$args)
Validates URI record content according to RFC 7553 and RFC 3986
URI records have the format: