Apps/ZoneAliasApp/README.md
A DNS App for Technitium DNS Server that enables aliasing of DNS zones by mapping multiple zone names to return identical resource records from a primary zone.
This application intercepts authoritative DNS queries and rewrites zone names based on configured alias mappings, allowing administrators to serve the same DNS records for multiple domain names without zone duplication.
The Zone Alias App extends the core DNS server's authoritative response handling by implementing zone aliasing functionality. When a DNS query matches a configured alias, the app internally rewrites the query to the primary zone, retrieves records, and transforms them back to match the original queried zone name.
Key capabilities:
This application provides significant administrative value by reducing zone management overhead and enabling multi-domain DNS strategies without record duplication.
This app provides an alternative to maintaining multiple identical zones. Administrators must choose between:
Option A: Use native DNS zone management with separate zone files for each domain
Option B: Use the Zone Alias App to map multiple domains to a single zoneUsing both approaches simultaneously for the same domains may result in conflicting responses, unpredictable query resolution, and operational confusion.
The Zone Alias App operates at the authoritative request handler level with configurable preference ordering. Ensure the appPreference value is set appropriately relative to other DNS apps to control processing order.
The application is configured using the dnsApp.config file in JSON format. The configuration structure supports global aliasing settings and zone-specific alias mappings.
| Property | Type | Default | Description |
|---|---|---|---|
appPreference | byte | 10 | Processing order priority for this app relative to other DNS apps. Lower values execute earlier in the request pipeline. |
enableAliasing | boolean | true | Global flag to enable or disable zone aliasing functionality. When false, all aliasing is disabled regardless of configured mappings. |
zoneAliases | object | (empty) | Object defining zone alias mappings. Each property name is the primary zone, with an array of alias zone names as the value. |
The zoneAliases configuration object maps primary zones to their aliases. Each property represents one primary zone with one or more alias zones.
Structure:
{
"zoneAliases": {
"primary-zone.com": ["alias1.com", "alias2.net"],
"another-zone.org": ["mirror.org"]
}
}
primary-zone.com): The authoritative zone containing the actual DNS recordsBehavior:
alias1.com or alias2.net will return records from primary-zone.comwww.alias1.com → www.primary-zone.com){
"appPreference": 10,
"enableAliasing": true,
"zoneAliases": {
"example.com": ["example.net", "example.org"],
"company.internal": ["company.local", "company.lan"],
"service.cloud": ["service.backup"]
}
}
This configuration:
10)example.net and example.org resolve using records from example.comcompany.local and company.lan resolve using records from company.internalservice.backup resolves using records from service.cloudThe Zone Alias App processes DNS queries through the following pipeline:
DirectQueryAsync method for authoritative resolution against the primary zone.If aliasing is disabled, no alias is matched, or query processing fails, the app returns control to the DNS server's standard resolution pipeline.
brand-a.com, brand-b.net) can maintain DNS records in a single zone while presenting different domain names to users.service.us, service.eu, service.asia) can serve identical infrastructure records without zone duplication.app.production) can be aliased to staging or testing domains (app.staging, app.dev) to mirror production DNS configuration.Symptoms: DNS queries to alias zones return NXDOMAIN or no records.
Diagnostic steps:
enableAliasing is set to true in dnsApp.config.zoneAliases configuration object.Configuration check:
{
"enableAliasing": true,
"zoneAliases": {
"primary.com": ["alias.com"]
}
}
Ensure the alias zone (alias.com) does not exist as a separate zone on the DNS server.
Symptoms: DNS responses contain records with the primary zone name instead of the alias zone name.
Diagnostic steps:
ConvertRecords function.appPreference value allows the app to execute in the correct order.This issue may indicate a malfunction in record transformation logic or app loading failure.
Symptoms: Queries to alias zones return SERVFAIL (response code 2).
Diagnostic steps:
Common causes:
Symptoms: Inconsistent responses when the same domain is configured both as an alias and as a native zone.
Diagnostic steps:
appPreference value to understand processing order.Resolution:
Remove either the native zone or the alias configuration. Operating both simultaneously for the same domain violates DNS consistency requirements.