Apps/AdvancedBlockingApp/README.md
A DNS App for Technitium DNS Server that provides advanced domain blocking capabilities with support for client-based group policies, multiple block list formats, and fine-grained control over blocking behavior.
The Advanced Blocking App extends the DNS server's blocking capabilities by allowing administrators to:
When this app is installed and enabled, it operates independently from the DNS server's built-in blocking feature.
The Advanced Blocking App does NOT use the block lists configured in the DNS server's Settings > Blocking page. You must configure all block lists, allow lists, and blocking behavior within the app's own configuration.
You should choose one approach:
- Option A: Use the DNS server's built-in blocking (Settings > Blocking) and do NOT install this app
- Option B: Install this app and configure ALL your blocking rules here, ignoring the built-in blocking settings
Using both simultaneously may lead to confusion, as they process requests independently. The app's blocking is evaluated during the request processing pipeline and may take precedence based on processing order.
The app is configured via a JSON configuration file (dnsApp.config). Below is a complete reference of all configuration options:
| Property | Type | Default | Description |
|---|---|---|---|
enableBlocking | boolean | true | Master switch to enable or disable all blocking |
blockingAnswerTtl | integer | 30 | TTL (in seconds) for blocking responses |
blockListUrlUpdateIntervalHours | integer | 24 | Hours between automatic block list updates |
blockListUrlUpdateIntervalMinutes | integer | 0 | Additional minutes for update interval |
localEndPointGroupMap | object | {} | Maps local DNS endpoints to group names |
networkGroupMap | object | {} | Maps client networks/IPs to group names |
groups | array | [] | Array of group definitions |
Maps specific DNS server endpoints to groups. Useful when running multiple DNS listeners (e.g., DoH, DoT, standard DNS) and wanting different policies for each.
"localEndPointGroupMap": {
"127.0.0.1": "bypass",
"192.168.10.2:53": "bypass",
"user1.dot.example.com": "kids",
"user2.doh.example.com:443": "bypass"
}
Maps client IP addresses or subnets to groups. More specific matches take precedence.
"networkGroupMap": {
"192.168.10.20": "kids",
"192.168.10.0/24": "standard",
"0.0.0.0/0": "everyone",
"::/0": "everyone"
}
Each group defines its own blocking policy:
| Property | Type | Default | Description |
|---|---|---|---|
name | string | required | Unique group identifier |
enableBlocking | boolean | true | Enable blocking for this group |
allowTxtBlockingReport | boolean | true | Return blocking metadata in TXT queries and EDNS Extended DNS Error |
blockAsNxDomain | boolean | false | Return NXDOMAIN instead of custom IP for blocked domains |
blockingAddresses | array | [] | IP addresses to return for blocked A/AAAA queries |
allowed | array | [] | Domains explicitly allowed (whitelist) |
blocked | array | [] | Domains explicitly blocked |
allowListUrls | array | [] | URLs to domain allow lists |
blockListUrls | array | [] | URLs to domain block lists (string or object) |
allowedRegex | array | [] | Regex patterns for allowed domains |
blockedRegex | array | [] | Regex patterns for blocked domains |
regexAllowListUrls | array | [] | URLs to regex allow list files |
regexBlockListUrls | array | [] | URLs to regex block list files |
adblockListUrls | array | [] | URLs to AdBlock-format lists |
Block list URLs can be specified as simple strings or as objects with additional options:
Simple format:
"blockListUrls": [
"https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts"
]
Object format with custom options:
"blockListUrls": [
{
"url": "https://example.com/blocklist.txt",
"blockAsNxDomain": false,
"blockingAddresses": ["192.168.10.2"]
}
]
{
"enableBlocking": true,
"blockingAnswerTtl": 30,
"blockListUrlUpdateIntervalHours": 24,
"blockListUrlUpdateIntervalMinutes": 0,
"localEndPointGroupMap": {
"127.0.0.1": "bypass"
},
"networkGroupMap": {
"192.168.10.0/24": "kids",
"0.0.0.0/0": "everyone",
"::/0": "everyone"
},
"groups": [
{
"name": "everyone",
"enableBlocking": true,
"allowTxtBlockingReport": true,
"blockAsNxDomain": true,
"blockingAddresses": ["0.0.0.0", "::"],
"allowed": [],
"blocked": ["example.com"],
"allowListUrls": [],
"blockListUrls": [
"https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts"
],
"allowedRegex": [],
"blockedRegex": ["^ads\\."],
"regexAllowListUrls": [],
"regexBlockListUrls": [],
"adblockListUrls": []
},
{
"name": "kids",
"enableBlocking": true,
"allowTxtBlockingReport": true,
"blockAsNxDomain": false,
"blockingAddresses": ["0.0.0.0", "::"],
"allowed": [],
"blocked": [],
"allowListUrls": [],
"blockListUrls": [
{
"url": "https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/social/hosts",
"blockAsNxDomain": false,
"blockingAddresses": ["192.168.10.2"]
}
],
"allowedRegex": [],
"blockedRegex": [],
"regexAllowListUrls": [],
"regexBlockListUrls": [],
"adblockListUrls": []
},
{
"name": "bypass",
"enableBlocking": false,
"allowTxtBlockingReport": true,
"blockAsNxDomain": true,
"blockingAddresses": ["0.0.0.0", "::"],
"allowed": [],
"blocked": [],
"allowListUrls": [],
"blockListUrls": [],
"allowedRegex": [],
"blockedRegex": [],
"regexAllowListUrls": [],
"regexBlockListUrls": [],
"adblockListUrls": []
}
]
}
Standard hosts-file format or plain domain lists:
# Comment line
0.0.0.0 ads.example.com
127.0.0.1 tracking.example.com
malware.example.com
One regex pattern per line:
# Block all subdomains starting with "ads"
^ads\.
# Block tracking domains
.*tracking.*\.com$
Supports a subset of AdBlock syntax:
! Comment
||ads.example.com^
||tracking.example.com^$all
@@||safe.example.com^
Group Selection: When a DNS request arrives, the app determines which group applies based on:
localEndPointGroupMap)networkGroupMap)Allow Check: If the domain matches any allow list (static, URL-based, regex, or AdBlock whitelist), the request is NOT blocked.
Block Check: If the domain matches any block list, the app returns:
NXDOMAIN if blockAsNxDomain is trueblockingAddresses for A/AAAA queriesBlocking Report: When allowTxtBlockingReport is enabled:
enableBlocking is true at both root and group levelQuery a TXT record for a blocked domain from the client IP address to see the blocking report:
dig TXT blocked-domain.com @your-dns-server