The DNS Record Validator performs syntax and semantic validation according to DNS RFCs, checking both record format and domain name compliance.
A Record Validation (IPv4):
- Format: name IN A ipv4_address
- Example: www.example.com IN A 192.0.2.1
- Checks:
- Value is valid IPv4 address (0.0.0.0 - 255.255.255.255)
- No invalid octets (e.g., 256.1.1.1)
- Proper dotted-decimal format
- Common errors: "999.999.999.999", "192.168.1", "192.168.1.1.1"
AAAA Record Validation (IPv6):
- Format: name IN AAAA ipv6_address
- Example: www.example.com IN AAAA 2001:db8::1
- Checks:
- Valid IPv6 address with proper hextet format
- Correct compression (:: only once)
- Hexadecimal digits only (0-9, a-f)
- Common errors: "gggg::1", "2001:db8:::1", invalid compression
CNAME Record Validation:
- Format: alias IN CNAME target.domain.com.
- Example: www.example.com IN CNAME target.example.com.
- Checks:
- Target is valid domain name
- Domain labels follow DNS naming rules
- Total length < 253 characters
- Label length < 63 characters
- Warnings:
- CNAME at zone apex (not allowed per RFC)
- CNAME with other record types (violates RFC 1034)
- Common errors: Invalid characters, labels too long, missing trailing dot
MX Record Validation:
- Format: domain IN MX priority mailserver.domain.com.
- Example: example.com IN MX 10 mail.example.com.
- Checks:
- Priority is 0-65535 (16-bit unsigned integer)
- Mail server is valid domain name
- Proper format: "priority hostname"
- Best practices:
- Lower priority = higher preference
- Multiple MX records for redundancy
- MX target should have A/AAAA record (not CNAME)
- Common errors: Missing priority, invalid priority range, IP instead of hostname
TXT Record Validation:
- Format: name IN TXT "text value"
- Example: example.com IN TXT "v=spf1 include:_spf.google.com ~all"
- Checks:
- Total length < 255 characters per string
- Multiple strings concatenated if longer
- Proper quoting of special characters
- Common uses:
- SPF records: "v=spf1 ..."
- DKIM: "v=DKIM1; k=rsa; p=..."
- DMARC: "v=DMARC1; p=reject; ..."
- Domain verification: "google-site-verification=..."
SRV Record Validation:
- Format: _service._proto.name IN SRV priority weight port target
- Example: _sip._tcp.example.com IN SRV 10 60 5060 sipserver.example.com.
- Checks:
- Priority: 0-65535
- Weight: 0-65535 (load balancing)
- Port: 1-65535
- Target: Valid domain name or "." for unavailable service
- Name format: _service._protocol.domain
- Service: _http, _sip, _ldap, _xmpp, etc.
- Protocol: _tcp or _udp
- Common errors: Missing underscore, invalid port, wrong parameter order
Domain Name Validation Rules:
- Label rules:
- 1-63 characters per label
- Start with letter or digit, end with letter or digit
- Middle can contain hyphens
- No consecutive dots
- Total length: Maximum 253 characters for FQDN
- Characters: Letters, digits, hyphens (a-z, A-Z, 0-9, -)
- Case insensitive: Example.COM = example.com
- Trailing dot: Indicates FQDN (example.com.)
Common Validation Errors:
- Invalid IP format: Typos, out-of-range octets/hextets
- Invalid domain name: Special characters, spaces, consecutive dots
- Label too long: > 63 characters in single label
- FQDN too long: > 253 characters total
- Missing parameters: Incomplete MX or SRV record
- Wrong format: IP in MX target, domain in A record
Best Practices:
- Always validate before deploying to production
- Use FQDN format with trailing dot for zone files
- Test with multiple validators (dig, nslookup, online tools)
- Document any non-standard configurations
- Set appropriate TTL before going live
- Keep backup of working DNS configuration