# DNS Hook
# About
The Enhance DNS Hook acts as an event-driven sync mechanism. Whenever a customer modifies a DNS record, the system automatically triggers a single HTTP request delivering a full snapshot of the updated DNS zone to your configured external endpoint.
# Technical Specifications
- Event delivery & behavior trigger: Customer updates a DNS record (create, edit, or delete).
-Payload Scope: Full zone export (contains the entire state of all DNS records for that zone, not just the modified record delta).
Delivery method: Single attempt (fire-and-forget).
Retry policy: No automatic retries. If the receiving system drops the request or returns an error, the update will not re-send until the customer saves another change.
# Implementation Requirements (Middleware)
To consume and handle this hook safely, developers must implement custom middleware:
-Endpoint ingestion: Create an HTTPS receiver endpoint capable of parsing the zone format below.
-Reliability & idempotency: Because delivery is fire-and-forget with no built-in retries, the receiving middleware should process payloads asynchronously (e.g., store the incoming event immediately in a message queue before processing) to avoid losing updates during downstream downtime.
You can rely on the SOA serial to ensure DNS requests are not processed out of order. The serial is incremented by Enhance on every DNS change.
-State reconciliation: Since each payload contains a full copy of the zone, the middleware should overwrite or reconcile its full local record state with the incoming payload.
Your API should accept the DNS zone data in this format:
{
"origin": "test.com.",
"soa": {
"adminEmail": "admin.test.com.",
"nameServer": "placeholder.test.com.",
"expire": 86400,
"refresh": 1400,
"retry": 7200,
"ttl": 1400
},
"records": [
{
"id": "83a31b98-25a3-4596-b357-5b94445f8b1c",
"kind": "CNAME",
"name": "ftp",
"value": "test.com.",
"proxy": false
},
{
"id": "c215bf99-f382-4dac-8d90-84b2da9eb874",
"kind": "TXT",
"name": "@",
"value": "v=spf1 a mx ~all",
"proxy": false
},
{
"id": "94df15e7-8609-4ab1-94bd-04dc8e5f1953",
"kind": "A",
"name": "@",
"value": "10.168.104.32",
"proxy": false
},
{
"id": "cf0f0098-0e83-4af1-b3ea-a2dcddeae642",
"kind": "CNAME",
"name": "www",
"value": "test.com.",
"proxy": false
},
{
"id": "457e5dd9-0e1c-4254-a051-a05b31d677a7",
"kind": "A",
"name": "mail",
"value": "10.168.104.32",
"proxy": false
},
{
"id": "8aa270f1-32b3-4ab4-9488-0f2bbf26912c",
"kind": "CNAME",
"name": "imap",
"value": "mail.test.com.",
"proxy": false
},
{
"id": "92082199-c973-4a73-b91e-3a10ee369aa3",
"kind": "MX",
"name": "@",
"value": "0 mail.test.com.",
"proxy": false
},
{
"id": "1af4d4e1-37f6-4328-9d00-24cd74c26a4f",
"kind": "CNAME",
"name": "pop",
"value": "mail.test.com.",
"proxy": false
},
{
"id": "73628703-964a-4a54-9d2f-19ade6050098",
"kind": "CNAME",
"name": "smtp",
"value": "mail.test.com.",
"proxy": false
},
{
"id": "f835ebac-1e93-477e-9a6b-a9444d003483",
"kind": "A",
"name": "mysql",
"value": "10.168.104.32",
"proxy": false
}
]
}