DNS Zone File Tools & Delegation Check API
Validate BIND zone files, convert BIND ↔ JSON ↔ CSV (Cloudflare, Route 53), diff a zone against live DNS and check NS delegation and DNSSEC.
validate / parse read a BIND zone file ($ORIGIN, $TTL, parentheses, relative names, TTL units like 1h / 2w; $INCLUDE and $GENERATE are refused) and check it: SOA and apex NS, CNAME next to other data or at the apex, MX / NS / SRV pointing to a CNAME or an IP, in-zone NS without glue, targets without addresses, RRsets with different TTLs, duplicates, SOA timers (RFC 1912), TXT strings over 255 bytes, several SPF records, SPF over 10 DNS lookups, +all, DMARC syntax, CAA tags, private IPs, out-of-zone names, very low / high TTLs. parse also returns the records as JSON.
convert turns BIND, JSON (also Cloudflare API exports with priority fields and Route 53 record sets) or CSV into json, bind (relative names), csv, cloudflare (BIND import file without SOA / apex NS) or route53 (ChangeResourceRecordSets batch). diff queries every name / type of the zone over DNS-over-HTTPS (1.1.1.1, up to 100 RRsets) and shows what matches, differs or is missing live — useful before moving DNS to another provider.
delegation (send domain) compares the registry nameservers (RDAP) with the zone NS set, resolves every nameserver, flags lame or single nameservers and nameservers in one /24 (RFC 2182), shows the SOA and checks DNSSEC: DS ↔ DNSKEY key tags and digests are recomputed locally, and the validation status comes from a validating resolver. Workers can only use DNS over HTTPS, so glue at the registry, per-nameserver SOA serials and zone transfers cannot be checked.
Markdown · OpenAPI · Postman · llms.txt
Parameters
| Name | In | Type | Required | Default | |
|---|---|---|---|---|---|
action | body|query | string | no | parse | parse, validate, convert, diff or delegation (alias mode; delegation when only domain is sent). |
zone | body | string | no | Zone file (BIND), JSON records or CSV (or file / raw body; max 2 MB, 20,000 records). | |
domain | body|query | string | no | Zone origin for relative names, or the domain for delegation. | |
from | body|query | string | no | auto | auto, bind, json or csv. |
to | body|query | string | no | json | convert: json, bind, csv, cloudflare or route53. |
relative | body|query | boolean | no | true | convert to bind: relative names. |
max_queries | body|query | number | no | 60 | diff: RRsets queried (1-100). |
Example
curl -X POST "https://apibox.io.vn/v1/dns-zone" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"action":"validate","zone":"$ORIGIN example.com.\n$TTL 3600\n@ IN SOA ns1.example.com. hostmaster.example.com. 2026111601 7200 900 1209600 300\n IN NS ns1.example.com.\n IN NS ns2.example.net.\n IN MX 10 mail\n@ IN TXT \"v=spf1 mx include:_spf.google.com ~all\"\nns1 IN A 203.0.113.53\nmail IN CNAME mx.provider.net.\nwww IN CNAME @\nwww IN TXT \"verify=1\"\n"}'const res = await fetch('https://apibox.io.vn/v1/dns-zone', {
method: 'POST',
headers: {
Authorization: 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
"action": "validate",
"zone": "$ORIGIN example.com.\n$TTL 3600\n@ IN SOA ns1.example.com. hostmaster.example.com. 2026111601 7200 900 1209600 300\n IN NS ns1.example.com.\n IN NS ns2.example.net.\n IN MX 10 mail\n@ IN TXT \"v=spf1 mx include:_spf.google.com ~all\"\nns1 IN A 203.0.113.53\nmail IN CNAME mx.provider.net.\nwww IN CNAME @\nwww IN TXT \"verify=1\"\n"
}),
});
const data = await res.json();
console.log(data);import requests
res = requests.post(
"https://apibox.io.vn/v1/dns-zone",
headers={"Authorization": "Bearer YOUR_API_KEY"},
json={"action": "validate", "zone": "$ORIGIN example.com.\n$TTL 3600\n@ IN SOA ns1.example.com. hostmaster.example.com. 2026111601 7200 900 1209600 300\n IN NS ns1.example.com.\n IN NS ns2.example.net.\n IN MX 10 mail\n@ IN TXT \"v=spf1 mx include:_spf.google.com ~all\"\nns1 IN A 203.0.113.53\nmail IN CNAME mx.provider.net.\nwww IN CNAME @\nwww IN TXT \"verify=1\"\n"},
timeout=30,
)
print(res.json())<?php
$ch = curl_init('https://apibox.io.vn/v1/dns-zone');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => ['Authorization: Bearer YOUR_API_KEY', 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => '{"action":"validate","zone":"$ORIGIN example.com.\\n$TTL 3600\\n@ IN SOA ns1.example.com. hostmaster.example.com. 2026111601 7200 900 1209600 300\\n IN NS ns1.example.com.\\n IN NS ns2.example.net.\\n IN MX 10 mail\\n@ IN TXT \\"v=spf1 mx include:_spf.google.com ~all\\"\\nns1 IN A 203.0.113.53\\nmail IN CNAME mx.provider.net.\\nwww IN CNAME @\\nwww IN TXT \\"verify=1\\"\\n"}',
]);
$response = curl_exec($ch);
print_r(json_decode($response, true));Response
{
"valid": false,
"origin": "example.com.",
"records": 9,
"types": {
"SOA": 1,
"NS": 2,
"MX": 1,
"TXT": 2,
"A": 1,
"CNAME": 2
},
"errors": 2,
"warnings": 0,
"info": 1,
"findings": [
{
"rule": "mx-to-cname",
"severity": "error",
"message": "MX example.com. points to mail.example.com., which is a CNAME (RFC 2181 10.3)",
"line": 6,
"name": "example.com."
},
{
"rule": "cname-coexist",
"severity": "error",
"message": "www.example.com. has a CNAME and other data (TXT): not allowed (RFC 1034 3.6.2, RFC 2181 10.1)",
"line": 10,
"name": "www.example.com."
},
{
"rule": "spf-lookups",
"severity": "info",
"message": "SPF at example.com.: 2 lookups counted here, plus whatever _spf.google.com uses (check with /v1/email-auth)",
"line": 7,
"name": "example.com."
}
]
}
Use cases
- Check a zone file exported from a Vietnamese registrar before importing it into Cloudflare
- Convert a zone to a Route 53 change batch or a CSV for review
- Compare the planned zone with the live DNS before switching nameservers
- Verify NS delegation and the DNSSEC DS record after a registrar change
FAQ
Which zone formats are accepted?
BIND / RFC 1035 master files, JSON arrays of {name, ttl, type, data} (Cloudflare API export and Route 53 record sets too) and CSV with name, type and data / value / content columns.
Can it check SOA serials on each nameserver?
No. Cloudflare Workers cannot send UDP / TCP port 53 queries; only DNS-over-HTTPS through a public resolver is available.
Does it try a zone transfer (AXFR)?
No, never: zone transfers of third-party domains are reconnaissance. Send your own zone file instead.
Related APIs
IP Geolocation
Look up the country, region, city, coordinates, ASN and ISP of any IPv4 or IPv6 address – or your own IP – in one fast JSON call.
DNSDNS Lookup
Query A, AAAA, MX, TXT, NS, CNAME, SOA, CAA, SRV and more for any domain, or reverse-lookup an IP (PTR), via DNS over HTTPS. Clean JSON output.
@Email Validator
Validate e-mail addresses: syntax, MX/A records, ~120k disposable domains, role accounts, free providers and typo hints like gmial.com → gmail.com.