Apps/DnsRebindingProtectionApp/README.md
A DNS App for Technitium DNS Server that protects against DNS rebinding attacks by filtering private IP addresses from DNS responses for non-local domain names.
IDnsApplication, IDnsPostProcessorThis application extends Technitium DNS Server by implementing IDnsPostProcessor to analyze DNS query responses before they are returned to clients. The app prevents DNS rebinding attacks by:
This protection is critical for environments where clients access both internal and external resources, preventing malicious websites from accessing internal network services.
This app will remove private IP addresses from DNS responses for any domain name not explicitly listed in the privateDomains configuration.
Processing behavior:
example.com → 192.168.1.1), those records will be removed from the responseprivateDomains are permitted to resolve to private IP addressesConfiguration options:
privateDomains arraybypassNetworks to exclude them from protectionProcessing order:
The app processes responses after the DNS server completes resolution but before sending the response to the client. Filtering applies only to non-authoritative answers.
Open the Technitium DNS Server web console
Navigate to Apps section
Click App Store and find the DNS Rebinding Protection App to install
Configure the app by clicking on the Config button
The application is configured through the dnsApp.config file located in the app's installation directory.
The configuration uses a JSON structure with four root-level properties that control protection behavior, network definitions, and domain exemptions.
| Property | Type | Default | Description |
|---|---|---|---|
enableProtection | Boolean | true | Master switch to enable or disable DNS rebinding protection globally |
bypassNetworks | Array of Strings | [] | List of CIDR network ranges for client IP addresses that should bypass protection entirely |
privateNetworks | Array of Strings | See below | List of CIDR network ranges considered private; responses containing these IPs will be filtered |
privateDomains | Array of Strings | ["home.arpa"] | List of domain names permitted to resolve to private IP addresses without filtering |
The privateNetworks array defines which IP address ranges are considered private and subject to rebinding protection.
Default configuration includes all RFC-defined private ranges:
"privateNetworks": [
"10.0.0.0/8",
"127.0.0.0/8",
"172.16.0.0/12",
"192.168.0.0/16",
"169.254.0.0/16",
"fc00::/7",
"fe80::/10"
]
Purpose: Any DNS response containing IP addresses within these ranges will be filtered unless the domain is listed in privateDomains or the client is in bypassNetworks.
Use case: Organizations may customize this list to include additional private address space (e.g., Carrier-Grade NAT 100.64.0.0/10) or remove ranges not used in their environment.
The privateDomains array specifies domain names that are exempt from filtering and may legitimately resolve to private IP addresses.
Format conventions:
internal.local also permits server.internal.local)Example:
"privateDomains": [
"home.arpa",
"internal.local",
"corp.example.com"
]
The bypassNetworks array defines client IP ranges that completely bypass rebinding protection.
Purpose: Trusted networks (e.g., administrative subnets) can receive unfiltered DNS responses.
Use case: Internal management networks or developer workstations requiring access to split-horizon DNS configurations.
Example:
"bypassNetworks": [
"10.50.0.0/24",
"192.168.100.0/24"
]
{
"enableProtection": true,
"bypassNetworks": [
"10.50.0.0/24"
],
"privateNetworks": [
"10.0.0.0/8",
"127.0.0.0/8",
"172.16.0.0/12",
"192.168.0.0/16",
"169.254.0.0/16",
"fc00::/7",
"fe80::/10"
],
"privateDomains": [
"home.arpa",
"internal.local",
"corp.example.com",
"lab.local"
]
}
This configuration:
10.50.0.0/24 from all filtering*.home.arpa, *.internal.local, *.corp.example.com, and *.lab.localThe app supports standard CIDR notation for both IPv4 and IPv6 networks:
IPv4 CIDR notation:
192.168.1.0/24
10.0.0.0/8
IPv6 CIDR notation:
fc00::/7
fe80::/10
2001:db8::/32
Single host addresses:
192.168.1.1/32
::1/128
The app applies the following processing pipeline to each DNS response:
Bypass check: If enableProtection is false or the response has the AuthoritativeAnswer flag set, return the response unmodified
Client network check: Compare the client IP address against each entry in bypassNetworks; if matched, return the response unmodified
Record inspection: For each A or AAAA record in the answer section:
privateDomains (including parent zones)privateNetworks rangeResponse modification: If any records were marked for removal, create a new response with only the allowed records
Client delivery: Return either the original response (if no rebinding detected) or the filtered response
Enterprise split-horizon DNS deployment: Allow internal domain names like intranet.corp.local to resolve to 10.x.x.x addresses while blocking external domains from returning private IPs.
ISP customer protection: Prevent DNS rebinding attacks against residential gateway devices (typically at 192.168.x.x) by filtering private IP responses for all public domain queries.
Home network security: Protect IoT devices and home servers from cross-site request forgery attacks leveraging DNS rebinding against 192.168.1.x addresses.
Development environment isolation: Use bypassNetworks to allow developer machines unrestricted DNS access while protecting production client networks.
Multi-site organization: Configure different privateDomains lists for each site's internal naming conventions (e.g., site1.internal, site2.internal).
IPv6 dual-stack protection: Prevent rebinding attacks targeting unique local addresses (fc00::/7) and link-local addresses (fe80::/10) in IPv6-enabled networks.
Symptoms: Queries for internal domain names return empty responses or SERVFAIL.
Diagnostic steps:
privateDomains configurationexample.local permits host.example.local)Resolution: Add the affected domain to the privateDomains array in dnsApp.config.
Symptoms: Public domain names are resolving to private IP addresses without filtering.
Diagnostic steps:
enableProtection is set to truebypassNetworksAuthoritativeAnswer flag setprivateNetworksResolution: Review the configuration for unintended bypass rules or missing private network definitions.
Symptoms: Split-horizon DNS or internal services are inaccessible due to filtered responses.
Diagnostic steps:
privateDomainsResolution: Add the affected domains to privateDomains or add the client network to bypassNetworks.
Symptoms: Modifications to dnsApp.config do not change app behavior.
Diagnostic steps:
dnsApp.config file is in the correct app directoryResolution: Reload the app through the web console by saving its config again.