Apps/DefaultRecordsApp/README.md
A DNS App for Technitium DNS Server that applies configurable default DNS records to authoritative zones during query post-processing.
This application enables system administrators to define reusable sets of DNS resource records and map them to specific zones or all zones using wildcard patterns. Default records are injected into DNS responses when the server returns authoritative answers, allowing for centralized management of common DNS records across multiple zones.
The Default Records App extends Technitium DNS Server's core functionality by implementing a post-processor that intercepts authoritative DNS responses and conditionally injects predefined DNS resource records.
Key capabilities include:
NOERROR or NXDOMAIN codesThis application is particularly useful for administrators managing multiple zones that share common DNS records such as SPF, DKIM, MX, or branding-related CNAME records.
The application is configured using a JSON file named dnsApp.config located in the app's installation directory.
The configuration file defines three primary components: global settings, zone-to-set mappings, and record sets.
| Property | Type | Default | Description |
|---|---|---|---|
enableDefaultRecords | boolean | false | Master switch to enable or disable default record processing |
defaultTtl | unsigned integer | 3600 | Default TTL (in seconds) applied to records when not explicitly specified in zone file format |
zoneSetMap | object | {} | Maps zone names (or patterns) to arrays of set names |
sets | array | [] | Array of record set objects defining reusable DNS records |
The zoneSetMap object defines which record sets apply to which zones.
Purpose: Controls the scope of default record application by mapping zone names to one or more record sets.
Key Features:
"example.org")"*.net" applies to all .net zones)"*") applies to all zones not matched by more specific rulesJSON Example:
"zoneSetMap": {
"*": ["global-set"],
"*.com": ["commercial-set"],
"*.net": ["network-set", "email-set"],
"example.org": ["custom-set", "email-set"]
}
Matching Logic:
*.parent.zone) are checked before ascending to parent zones*) is used only when no other match is foundEach object in the sets array defines a named collection of DNS resource records.
| Property | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Unique identifier for the set, referenced in zoneSetMap |
enable | boolean | Yes | Whether this set is active; disabled sets are ignored even if mapped |
records | array of strings | Yes | DNS resource records in standard zone file format |
JSON Example:
"sets": [
{
"name": "email-set",
"enable": true,
"records": [
"@ 3600 IN MX 10 mail.example.com.",
"@ 3600 IN TXT \"v=spf1 a mx -all\"",
"@ 3600 IN TXT \"v=DMARC1; p=reject; rua=mailto:[email protected]\""
]
},
{
"name": "web-set",
"enable": true,
"records": [
"www 3600 IN CNAME @",
"ftp 3600 IN CNAME @"
]
}
]
Records in the records array must follow the standard zone file syntax as defined in RFC 1035.
Format: <name> <ttl> <class> <type> <rdata>
Simple Example:
@ 3600 IN A 192.0.2.1
www 7200 IN CNAME @
Advanced Example:
@ 3600 IN MX 10 mail.example.com.
@ 3600 IN TXT "v=spf1 ip4:192.0.2.0/24 -all"
_dmarc 3600 IN TXT "v=DMARC1; p=quarantine; rua=mailto:[email protected]"
mail 3600 IN A 192.0.2.10
mail 3600 IN AAAA 2001:db8::10
Formatting Conventions:
@ symbol represents the zone apex (e.g., example.com)defaultTtl is applied{
"enableDefaultRecords": true,
"defaultTtl": 3600,
"zoneSetMap": {
"*": ["global-defaults"],
"*.com": ["commercial-branding"],
"*.org": ["nonprofit-email"],
"example.net": ["custom-example-net"]
},
"sets": [
{
"name": "global-defaults",
"enable": true,
"records": [
"@ 3600 IN TXT \"v=spf1 -all\"",
"www 3600 IN CNAME @"
]
},
{
"name": "commercial-branding",
"enable": true,
"records": [
"www 7200 IN CNAME @",
"ftp 7200 IN CNAME @",
"mail 3600 IN A 203.0.113.10"
]
},
{
"name": "nonprofit-email",
"enable": true,
"records": [
"@ 3600 IN MX 10 mail.example.org.",
"@ 3600 IN TXT \"v=spf1 mx -all\"",
"_dmarc 3600 IN TXT \"v=DMARC1; p=reject\""
]
},
{
"name": "custom-example-net",
"enable": false,
"records": [
"test 300 IN A 198.51.100.1"
]
}
]
}
The Default Records App supports all DNS resource record types recognized by Technitium DNS Server and the TechnitiumLibrary zone file parser.
Commonly Used Types:
Format Examples:
@ 3600 IN A 192.0.2.1
@ 3600 IN AAAA 2001:db8::1
@ 3600 IN MX 10 mail.example.com.
@ 3600 IN TXT "v=spf1 mx -all"
_sip._tcp 3600 IN SRV 10 60 5060 sipserver.example.com.
@ 3600 IN CAA 0 issue "letsencrypt.org"
The application operates as a DNS post-processor that intercepts responses before they are sent to the client.
enableDefaultRecords is set to truezoneSetMap using hierarchical pattern matchingIN)CNAMEWildcard Zone Handling:
When a wildcard zone pattern is matched (e.g., "*.net"), the app queries the DNS server for the SOA record of the queried domain to determine the actual zone name before parsing records.
www CNAME records pointing to the zone apex across all commercial domains.Diagnostic Steps:
enableDefaultRecords is set to true in dnsApp.configzoneSetMapenable: trueNOERROR or NXDOMAINCheck Logs:
Look for errors related to zone file parsing or record format issues from the Logs section on the web console.
Diagnostic Steps:
zoneSetMap for overlapping patterns"*.com" not ".com")zoneSetMap are lowercase (case normalization is automatic)Configuration Check:
Ensure specific zone mappings appear after wildcard patterns in the map to avoid confusion during manual review (although JSON object order does not affect matching).
Diagnostic Steps:
IN)Example Error:
Invalid zone file entry: missing TTL or class
Resolution:
Correct the record format:
"records": [
"@ IN A 192.0.2.1" // Missing TTL - uses defaultTtl
]
Should be:
"records": [
"@ 3600 IN A 192.0.2.1"
]
Diagnostic Steps:
dig @server example.com SOAResolution:
Ensure the zone is properly configured as an authoritative zone in Technitium DNS Server before applying wildcard default records.