Apps/AutoPtrApp/README.md
A DNS App for Technitium DNS Server that automatically generates reverse DNS (PTR) responses for both IPv4 and IPv6 addresses based on configurable domain name templates.
This app enables dynamic PTR record responses in primary and forwarder zones without manually creating individual PTR records for every IP address. It constructs PTR responses by parsing the IP address from the reverse lookup query and formatting it into a domain name using configurable prefix, suffix, and separator patterns.
The Auto PTR App extends Technitium DNS Server's core functionality by providing automated PTR record generation for reverse DNS zones. Instead of maintaining extensive static PTR record sets, administrators can deploy APP records that dynamically construct responses based on the queried IP address.
Key capabilities:
This app is particularly valuable for environments requiring consistent, pattern-based reverse DNS naming without manual PTR record maintenance.
Open the Technitium DNS Server web console.
Navigate to Apps section.
Click App Store and find the Auto PTR app to install.
Configure APP records in the appropriate reverse DNS zone(s).
Configuration is performed per APP record deployment, not at the application level. The app itself requires no global configuration file (dnsApp.config contains no settings).
Each APP record uses JSON-formatted data to define the PTR response template.
When creating an APP record in a reverse DNS zone, use the following JSON structure:
| Property | Type | Default | Description |
|---|---|---|---|
prefix | string | "" (empty) | Static string prepended to the generated domain name |
suffix | string | "" (empty) | Static string appended to the generated domain name (typically the domain) |
ipSeparator | string | "" (empty) | Character(s) inserted between IP address components in the domain name |
The app constructs PTR responses as follows:
For IPv4 addresses:
ipSeparatorprefix and appends suffixFor IPv6 addresses:
2001 → 2001, 00db → 00db)ipSeparatorprefix and appends suffix{
"prefix": "",
"suffix": ".example.com",
"ipSeparator": "-"
}
Query: PTR for 1.0.168.192.in-addr.arpa (reverse of 192.168.0.1)
Response: 192-168-0-1.example.com
{
"prefix": "host-",
"suffix": ".internal.example.net",
"ipSeparator": "."
}
Query: PTR for 10.20.30.10.in-addr.arpa (reverse of 10.30.20.10)
Response: host-10.30.20.10.internal.example.net
{
"prefix": "v6-",
"suffix": ".ip6.example.org",
"ipSeparator": "-"
}
Query: PTR for IPv6 reverse (e.g., 2001:db8::1)
Response: v6-2001-0db8-0000-0000-0000-0000-0000-0001.ip6.example.org
The app processes reverse DNS queries through the following execution pipeline:
Query Reception: The app receives a DNS query for a name within the reverse DNS zone where the APP record is configured.
Reverse Domain Parsing: The query name (QNAME) is parsed to extract the IP address using reverse DNS notation (in-addr.arpa for IPv4, ip6.arpa for IPv6).
Query Type Validation:
Domain Name Generation: The IP address is formatted into a domain name using the configured prefix, ipSeparator, and suffix values.
Response Construction: A DNS response is built containing a PTR record with the generated domain name and the APP record's configured TTL.
Response Transmission: The authoritative response is returned to the client with the AA (Authoritative Answer) flag set.
ip-192-0-2-1.customer.isp.example).Symptoms: Queries to the reverse DNS zone return NXDOMAIN or no answer.
Resolution:
168.192.in-addr.arpa for 192.168.0.0/16).0.168.192.in-addr.arpa for 192.168.0.0/24).Symptoms: PTR responses contain unexpected characters or formatting.
Resolution:
ipSeparator value for unintended characters or escape sequences.prefix and suffix values do not contain invalid DNS label characters.Symptoms: A, AAAA, or other query types to the reverse zone return unexpected results.
Resolution:
Symptoms: IPv6 PTR queries fail while IPv4 works correctly.
Resolution:
8.b.d.0.1.0.0.2.ip6.arpa).