Skip to Content
Browse documentation

DNS Hooks

Integrate DNS notifications with the current Eenos hook call sites, accepted actions, varying zone payloads and creation-path limitations.

PropertyValue
Function/directorydns
Pre scripts/var/eenos/hooks/dns/pre/
Post scripts/var/eenos/hooks/dns/post/
Delivered actionsCREATE, UPDATE, DELETE
Panel labelwap or uapp in literal current calls; a legacy builder passes its panel argument.

DNS hook calls occur around selected zone creation, rebuild and deletion operations. They are not a subscription to every DNS record write. Current account provisioning wraps create_account_zone with dns CREATE hooks, while account termination wraps each zone removal with dns DELETE hooks. UAPP domain/rebuild/delete helpers also contain explicit calls; a legacy zone builder forwards its panel/action arguments.

The uppercase action delivered to a script is CREATE, UPDATE or DELETE. The directory name is lowercase dns; an uppercase DNS directory will not match.

Payload variations

Creation and update payloads depend on the caller. Some provide the stored zone configuration; account creation provides its account-zone settings (addresses, nameservers and mail-policy settings), and some UAPP domain pre-hooks provide account data before the resulting zone mapping is available. Do not assume a single immutable record schema or treat this as a raw BIND zone-file stream. Inspect the required keys for your specific integration path.

Deletion callers pass an empty JSON object. Use the separate domain/user arguments to identify the target; do not require a zone record in data or expect the local zone to exist during post-delete handling.

Current DNS-add limitation

The current UAPP add_user_dns helper calls the hook manager with action add. The dispatcher accepts only CREATE, UPDATE and DELETE, so this particular call does not launch custom hook scripts. With a populated hook directory it reports an unsupported action. Creating an ADD branch inside your script cannot fix dispatch that never reaches it. Other supported CREATE callers remain separate paths.

Modern DNS record services do not automatically inherit hook coverage merely because the operation changes DNS. Verify the exact workflow you intend to integrate; do not claim complete cluster replication coverage from this hook alone.

Timing and results

Some callers issue post even when a rebuild reports failure; others only issue it on successful deletion or creation. The legacy builder writes zone metadata before invoking its pre-hook. Treat pre/post as positions in the particular caller, not universal before-any-write/committed-success guarantees. For external DNS synchronization, make updates idempotent, validate the action and domain, use bounded network timeouts and reconcile the resulting authoritative state.

Script contract

Each script receives command-line key=value arguments: base64-encoded JSON data, uppercase action, lowercase panel and optional domain/user. Use the argument decoder examples and installation guide. Scripts run in lexicographic filename order within each phase. There is no automatic retry, hook-specific timeout or parent-operation veto from a nonzero exit code.