Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
191 commits
Select commit Hold shift + click to select a range
e4a763d
Initial work to support installation on Alpine Linux
Wrong-Code Sep 15, 2025
5d8cdfb
Add support for installation on Alpine Linux
Wrong-Code Sep 15, 2025
8682977
Fix: if no virtual packages were installed, let 'apk del ...' fail si…
Wrong-Code Sep 15, 2025
0b933aa
Update DNS server image reference to pull podman from Docker Hub (#1668)
EliteSalman Feb 28, 2026
1d152e8
install.sh: updated install script to correctly configure network man…
ShreyasZare Feb 28, 2026
8c14edf
uninstall.sh: updated script to restore network manager to default co…
ShreyasZare Feb 28, 2026
c8f6a23
added contributing.md file
ShreyasZare Feb 28, 2026
dde8ff9
updated security.md file
ShreyasZare Feb 28, 2026
76b450d
added SupportedRFCs.md file
ShreyasZare Feb 28, 2026
9641dde
install.sh: updated install script to run dns service as non-root user.
ShreyasZare Mar 14, 2026
682f248
uninstall.sh: updated script to support install script changes. Added…
ShreyasZare Mar 14, 2026
afea5cd
systemd.service: updated systemd service config to run as non-root us…
ShreyasZare Mar 14, 2026
6b06ca2
DnsServerApp: updated app to allow running explicitly as a portable app.
ShreyasZare Mar 14, 2026
c1fec65
AuthManager: Updated SaveConfigFileInternal() to write config in tmp …
ShreyasZare Mar 14, 2026
85d54ee
UserSession: updated implementation to support ClusterApiToken and Si…
ShreyasZare Mar 14, 2026
a3f9209
ClusterManager: Updated constructor to find and convert API token to …
ShreyasZare Mar 14, 2026
14c5326
ClusterNode: Updated GetApiClient() to support cluster API token. Cod…
ShreyasZare Mar 14, 2026
41b09af
ClientFullyQualifiedDomainNameOption: updated ParseOptionValue() to h…
ShreyasZare Mar 14, 2026
7e4c704
DhcpServer: Updated DNS entry management implementation to allow havi…
ShreyasZare Mar 14, 2026
fce2093
Scope: Updated implementation to support persistent DNS entries for r…
ShreyasZare Mar 14, 2026
e31e81d
DnsApplication: Updated SetConfigAsync() to write config to tmp befor…
ShreyasZare Mar 14, 2026
e1ec9a9
DnsApplicationManager: code refactoring changes done.
ShreyasZare Mar 14, 2026
12bff31
InternalDnsServer: code refactoring changes done.
ShreyasZare Mar 14, 2026
ff8a642
AllowedZoneManager: Updated SaveZoneFileInternal() to write config to…
ShreyasZare Mar 14, 2026
f26964a
BlockedZoneManager: Updated SaveZoneFileInternal() to write config to…
ShreyasZare Mar 14, 2026
7095da9
BlockListZoneManager: Updated SaveConfigFileInternal() to write confi…
ShreyasZare Mar 14, 2026
ad39872
AuthZoneManager: Updated SaveZoneFileInternal() to write config to tm…
ShreyasZare Mar 14, 2026
4babe3a
CacheZoneManager: Updated ResolveCNAME() and Query() to allow queryin…
ShreyasZare Mar 14, 2026
3712143
ApexZone: code refactoring changes done.
ShreyasZare Mar 14, 2026
97bd286
PrimaryZone: implemented ActivateKskDnsKey() method. Code refactoring…
ShreyasZare Mar 14, 2026
f48b30e
SecondaryZone: Implemented RFC 7314 EDNS EXPIRE option support. Code …
ShreyasZare Mar 14, 2026
2fb8721
StubZone: Code refactoring changes done.
ShreyasZare Mar 14, 2026
1d57a16
DnsServer: Replaced PreferIPv6 with IPv6Mode feature. Implemented new…
ShreyasZare Mar 14, 2026
b255aa3
ResolverDnsCache: Code refactoring changes done.
ShreyasZare Mar 14, 2026
0c9b7bc
StatsManager: implemented support for lifetime counters.
ShreyasZare Mar 14, 2026
9b1a581
DnsWebService: Added explicit portable app support. Updated SaveConfi…
ShreyasZare Mar 14, 2026
9b80a5d
DnsWebServiceLegacy: code refactoring changes done.
ShreyasZare Mar 14, 2026
77c1094
LogManager: updated implementation to use platform specific log folde…
ShreyasZare Mar 14, 2026
5b7f0d4
WebServiceApi: Updated CheckForUpdateAsync() to remove extra data fro…
ShreyasZare Mar 14, 2026
53c7fd7
WebServiceAuthApi: updated implementation to support cluster api toke…
ShreyasZare Mar 14, 2026
897062f
WebServiceDhcpApi: code refactoring changes done.
ShreyasZare Mar 14, 2026
bbc9f50
WebServiceSettingsApi: Updated RestartService() to change restart seq…
ShreyasZare Mar 14, 2026
56457e3
WebServiceZonesApi: Updated code to support NS misconfigured mark fea…
ShreyasZare Mar 14, 2026
44abdd3
IDnsServer: Updated interface with a breaking change to support IPv6 …
ShreyasZare Mar 14, 2026
5e40504
HttpApiClient: Updated constructors to support ipv6 mode and setting …
ShreyasZare Mar 14, 2026
a0bad93
DnsServiceWorker: code refactoring changes done.
ShreyasZare Mar 14, 2026
838f56b
inno: updated appinstall code to allow new installations to run servi…
ShreyasZare Mar 14, 2026
e5ca681
inno: updated service code to support configuring LogOnAs parameter.
ShreyasZare Mar 14, 2026
5507204
docker-compose: Updated file to add new env vars. Updated to support …
ShreyasZare Mar 14, 2026
cc9cc3b
updated docker env vars to add 4 new variables.
ShreyasZare Mar 14, 2026
5945ff7
Merge branch 'develop' of https://github.com/TechnitiumSoftware/DnsSe…
ShreyasZare Mar 14, 2026
85e55a4
main.css: added new container width.
ShreyasZare Mar 14, 2026
c2f9882
fixed opendns addresses in dnsclient server list
ShreyasZare Mar 14, 2026
fe889ed
fixed opendns addresses in quick forwarders list
ShreyasZare Mar 14, 2026
a557fea
webapp: updated html to support new dashboard blocking options. Updat…
ShreyasZare Mar 14, 2026
e669cae
common.js: updated HTTPRequest() to support authorization bearer toke…
ShreyasZare Mar 14, 2026
e6b0d59
apps.js: implemented bearer token support.
ShreyasZare Mar 14, 2026
fd218dd
auth.js: implemented bearer token support. Added support for cluster …
ShreyasZare Mar 14, 2026
2ed5124
cluster.js: implemented bearer token support. Other minor changes done.
ShreyasZare Mar 14, 2026
320c62d
dhcp.js: implemented bearer token support.
ShreyasZare Mar 14, 2026
06ecaa3
dnsclient.js: implemented bearer token support.
ShreyasZare Mar 14, 2026
2244213
logs.js: implemented bearer token support. Implemented live update fe…
ShreyasZare Mar 14, 2026
d03dc52
other-zones.js: implemented bearer token support.
ShreyasZare Mar 14, 2026
3fd6cff
zone.js: implemented bearer token support. Added option to manually a…
ShreyasZare Mar 14, 2026
8f0740e
main.js: implemented bearer token support. Updated code to support EC…
ShreyasZare Mar 14, 2026
0dd2eb3
AdvancedBlocking: code refactoring changes done.
ShreyasZare Mar 14, 2026
6d97ebf
AdvancedBlocking: updated config example to avoid user confusion.
ShreyasZare Mar 14, 2026
0e161ad
AutoPtr: minor optimization changes.
ShreyasZare Mar 14, 2026
b49ade4
BlockPage: updated app to implement online cert signing feature to al…
ShreyasZare Mar 14, 2026
bb35417
Dns64: minor changes done.
ShreyasZare Mar 14, 2026
956f4f6
DnsBlockList: code refactoring changes done.
ShreyasZare Mar 14, 2026
510204c
Failover: code refactoring changes done.
ShreyasZare Mar 14, 2026
1a507b6
QueryLogsMySql: updated code to log TC response correctly.
ShreyasZare Mar 14, 2026
e74b862
QueryLogsSqlite: updated code to log TC response correctly.
ShreyasZare Mar 14, 2026
4600a94
QueryLogsSqlServer: updated code to log TC response correctly.
ShreyasZare Mar 14, 2026
d901af2
SplitHorizon.AddressTranslation: minor code changes.
ShreyasZare Mar 14, 2026
8c6976f
WildIp: updated app implementation to improve parsing logic. Added ne…
ShreyasZare Mar 14, 2026
7fae8da
webapp: minor css changes.
ShreyasZare Mar 14, 2026
b0cb7fa
install.sh: updated dotnet to 10.0
ShreyasZare Mar 21, 2026
b2b56f8
systemd.service: added env var to allow RSA+SHA1 DNSSEC algo.
ShreyasZare Mar 21, 2026
c783087
code refactoring changes done.
ShreyasZare Mar 21, 2026
732c906
ClusterManager: Updated UpdateClusterCatalogZoneOptions() to fix miss…
ShreyasZare Mar 21, 2026
36dae17
DnsServer: Added new option to configure udp listener socket send and…
ShreyasZare Mar 21, 2026
8b5689f
WebServiceSettingsApi: added support for udp send and receive buffer …
ShreyasZare Mar 21, 2026
ba2f3ae
webapp: Implemented support for new theme options. Added support for …
ShreyasZare Mar 21, 2026
9ae6fc0
main.js: Implemented new theme options feature. Added support for udp…
ShreyasZare Mar 21, 2026
0ec3a07
logs.js: fixed minor issue of resetting entries per page value.
ShreyasZare Mar 21, 2026
37bb60e
main.css: updated css for new theme options implementation.
ShreyasZare Mar 21, 2026
6d9e0a6
Fix dark mode readability and input elements using light theme (#1637)
Hezer Mar 21, 2026
519956e
main.css: fixed minor issue with close in dark mode PR.
ShreyasZare Mar 21, 2026
e4d72ca
AuthManager: updated implementation to support SSO. Code refactoring …
ShreyasZare Apr 3, 2026
cbf5ad4
User: updated implementation to support SSO. Code refactoring changes…
ShreyasZare Apr 3, 2026
3cfa18e
ClusterManager: Updated InitializeCluster() to disallow sso user to i…
ShreyasZare Apr 3, 2026
e67c903
ClusterNode: added CreateSsoUserAsync() and SetSsoUserAsync() api met…
ShreyasZare Apr 3, 2026
7b35d1d
DnsWebService: Updated code to implement SSO with OIDC. Moved Restart…
ShreyasZare Apr 3, 2026
169a555
Extensions: added new TryQueryOrForm() and TryQueryOrFormArray() meth…
ShreyasZare Apr 3, 2026
8e04f4c
WebServiceAuthApi: updated code to implement SSO. Updated the Create …
ShreyasZare Apr 3, 2026
238fd9a
WebServiceClusterApi: code refactoring changes done.
ShreyasZare Apr 3, 2026
1c789fc
WebServiceSettingsApi: moved RestartService() to main class. Code ref…
ShreyasZare Apr 3, 2026
554a143
HttpApiClient: Updated implementation to use Authorization Bearer hea…
ShreyasZare Apr 3, 2026
b85b4c0
updated docker env vars for SSO variables.
ShreyasZare Apr 3, 2026
f98f201
webapp: added oidc logo image.
ShreyasZare Apr 3, 2026
e622b60
auth.js: implemented code for SSO support. Implemented create token A…
ShreyasZare Apr 3, 2026
3ab96aa
common.js: added getCookie() and setCookie() methods.
ShreyasZare Apr 3, 2026
3862e2a
main.js: updated code to support SSO. Other minor changes done.
ShreyasZare Apr 3, 2026
13c014f
webapp: updated html to support SSO. Other minor changes done.
ShreyasZare Apr 3, 2026
6307837
DomainTree: removed "-" validation check.
ShreyasZare Apr 18, 2026
8fd6063
AuthZoneManager: Added DeleteAllRecords() method to delete all record…
ShreyasZare Apr 18, 2026
998ecbf
BlockListZoneManager: Updated BlockListUrls property to add URL valid…
ShreyasZare Apr 18, 2026
0f41dfc
ApexZone: Updated code to use InvariantCulture.
ShreyasZare Apr 18, 2026
eec7f44
DnsServer: Updated ProcessCNAMEAsync() to set ServerFailure RCODE and…
ShreyasZare Apr 18, 2026
4992e0c
StatsManager: Updated code to use InvariantCulture.
ShreyasZare Apr 18, 2026
42a7e8b
LogManager: Updated code to use InvariantCulture.
ShreyasZare Apr 18, 2026
cabf999
DnsWebService: Updated StartWebService() to set additional security h…
ShreyasZare Apr 18, 2026
0360cd5
WebServiceApi: code refactoring changes.
ShreyasZare Apr 18, 2026
0c564f7
WebServiceClusterApi: updated code to use InvariantCulture.
ShreyasZare Apr 18, 2026
99394e9
WebServiceLogsApi: updated code to use InvariantCulture.
ShreyasZare Apr 18, 2026
1ac999a
WebServiceSettingsApi: updated code to use InvariantCulture.
ShreyasZare Apr 18, 2026
c616e81
WebServiceZonesApi: Updated ImportZoneAsync() to add new "overwriteZo…
ShreyasZare Apr 18, 2026
4b4d8e9
zone.js: updated code to add support for import zone overwite zone op…
ShreyasZare Apr 18, 2026
0c61091
webapp: updated html to support overwrite zone option for import zone…
ShreyasZare Apr 18, 2026
5d3c555
minor changes.
ShreyasZare Apr 18, 2026
d781b73
added Quad9 DoQ entries to json files.
ShreyasZare Apr 18, 2026
15d1b75
DnsServerCore.ApplicationCommon: Updated interfaces to support nullable.
ShreyasZare Apr 18, 2026
9083195
DnsServerSystemTrayApp: nullable related changes done.
ShreyasZare Apr 18, 2026
14b446d
DnsServiceWorker: nullable related changes done.
ShreyasZare Apr 18, 2026
6c3344a
updated supporteed RFCs
ShreyasZare Apr 18, 2026
1cec6e0
updated API docs
ShreyasZare Apr 18, 2026
1e9d9eb
Fix incorrect endpoint for UpdateIpAddress in docs (#1830)
lachlan-stevens Apr 18, 2026
d1daef8
AdvancedBlocking: updated code to support comments in config.
ShreyasZare Apr 18, 2026
3561fe9
Updated apps to support conmments in config and APP record data.
ShreyasZare Apr 18, 2026
3e9b047
DnsRebindingProtection: Updated code to support comments in config. U…
ShreyasZare Apr 18, 2026
f2762d7
DropRequests: Updated code to support comments in config. Added new "…
ShreyasZare Apr 18, 2026
e1050be
Failover: updated code to use InvariantCulture.
ShreyasZare Apr 18, 2026
c231f83
GeoContinent: Updated code to support comments in config. Updated app…
ShreyasZare Apr 18, 2026
0274fa9
GeoCountry: Updated code to support comments in config. Implemented f…
ShreyasZare Apr 18, 2026
4fd65d6
GeoDistance: Updated code to support comments in config.
ShreyasZare Apr 18, 2026
dea5c7d
LogExporter: Updated code to use InvariantCulture. Code refactoring d…
ShreyasZare Apr 18, 2026
a32702f
QueryLogsMySql: Updated code to support comments in config. Nullable …
ShreyasZare Apr 18, 2026
40cb8e7
QueryLogsSqlite: Updated code to support comments in config. Nullable…
ShreyasZare Apr 18, 2026
5b385c0
QueryLogsSqlServer: Updated code to support comments in config. Nulla…
ShreyasZare Apr 18, 2026
76729dc
MispConnectorApp: removved the app since it is not feasible to be sup…
ShreyasZare Apr 18, 2026
6e63c3e
updated solution file
ShreyasZare Apr 18, 2026
7e375ba
Refactored DNS log pagination to use LIMIT and OFFSET in QueryLogsMyS…
jimstrang Apr 18, 2026
8809a4e
Query Logs Apps: fixed page number related bug introduced in PR #1702…
ShreyasZare Apr 18, 2026
a11bb47
Initial PostgreSQL functionality. (#1600)
scj643 Apr 18, 2026
1458e93
QueryLogsMySql: Updated qtype to unsigned smallint. Code refactoring …
ShreyasZare Apr 18, 2026
0cef76d
QueryLogsPostgres: Updated code to support comments in config. Update…
ShreyasZare Apr 18, 2026
5163b29
QueryLogsSqlite: minor changes done.
ShreyasZare Apr 18, 2026
1f8afc8
QueryLogsSqlServer: Updated qtype to INT. Other minor changes done.
ShreyasZare Apr 18, 2026
7afd844
Add Amber Theme for improved visual ergonomics and accessibility (#1810)
daedaevibin Apr 18, 2026
9acd526
webapp: moved dark mode and amber mode css code from main.css to inde…
ShreyasZare Apr 18, 2026
ed7cd7f
WebServiceAuthApi: Updated WriteSsoConfig() for minor changes.
ShreyasZare Apr 18, 2026
78c9401
Added README for Apps (#1704)
zbalkan Apr 18, 2026
b6fe70d
Merge branch 'app-docs-pr' into app-docs
ShreyasZare Apr 18, 2026
01cabd4
AdvancedForwarding: setting enableForwarding to false by default to a…
ShreyasZare Apr 19, 2026
a98b673
app-docs: updated app documentation with minor fixes and additions.
ShreyasZare Apr 19, 2026
7fdb54b
merged app-docs into develop
ShreyasZare Apr 19, 2026
f381a04
fixed typo in config
ShreyasZare Apr 25, 2026
3379790
renamed postgres app
ShreyasZare Apr 25, 2026
d1f2a87
updated app readme file to include database field values.
ShreyasZare Apr 25, 2026
8d2e52c
updated publish profiles for dotnet 10.0
ShreyasZare Apr 25, 2026
cdfaf5b
minor formating changes
ShreyasZare Apr 25, 2026
c717a23
uninstall.sh: updated script to ask before removing dotnet.
ShreyasZare Apr 25, 2026
1a4be6c
DnsServer: Fixed issue with final response generation in ProcessCNAME…
ShreyasZare Apr 25, 2026
9e6145d
logs.js: fixed form reset issue that did not reset app class path to …
ShreyasZare Apr 25, 2026
49e5a23
webapp: minor fixes.
ShreyasZare Apr 25, 2026
d1733d0
DnsWebService: updated ConfigureWebServiceRoutes() for metrics API.
ShreyasZare Apr 25, 2026
e75b7fd
updated named.root
ShreyasZare Apr 25, 2026
2dd1bd8
WebServiceAuthApi: Updated SsoLoginFinalizeAsync() to improve logging…
ShreyasZare Apr 25, 2026
9cec609
WebServiceDashboardApi: Added support for new metric API.
ShreyasZare Apr 25, 2026
c0aad82
inno: updated dotnet to v10.0.7 with code changes to simplify version…
ShreyasZare Apr 25, 2026
3bdeed9
updated apidocs.
ShreyasZare Apr 25, 2026
23e9eaf
updated solution file
ShreyasZare Apr 25, 2026
f94f09a
updated dockerfile for dotnet v10.0 upgrade
ShreyasZare Apr 25, 2026
38de540
minor update
ShreyasZare Apr 25, 2026
db4380b
Updated dotnet to v10.0. App assembly version updated for release.
ShreyasZare Apr 25, 2026
cb4f7b5
app store json updated
ShreyasZare Apr 25, 2026
538ab91
Dotnet updated to v10.0. Assembly version updated for release.
ShreyasZare Apr 25, 2026
e331b58
inno: updated version to v15.0.
ShreyasZare Apr 25, 2026
e332ea8
updated build instructions
ShreyasZare Apr 25, 2026
be2c6d3
updated changelog for v15.0 release.
ShreyasZare Apr 25, 2026
111ac6c
updated readme for v15.0 release.
ShreyasZare Apr 25, 2026
0de5dcf
AuthManager: Updated ReadConfigFrom() to fix a bug that caused issue …
ShreyasZare Apr 26, 2026
5a99fc3
DnsWebService: Updated StartWebServiceAsync() to add additional scope…
ShreyasZare Apr 26, 2026
6fb0f21
WebServiceDashboardApi: updated GetMetricsText() to fix typo issue.
ShreyasZare Apr 26, 2026
a9f1384
assembly version updated to v15.0.1 for release
ShreyasZare Apr 26, 2026
7df3aa7
inno: updated version to 15.0.1
ShreyasZare Apr 26, 2026
4715a13
updated changelog for v15.0.1
ShreyasZare Apr 26, 2026
fe9e864
fixed readme formatting issues.
ShreyasZare Apr 26, 2026
d3622fa
Merge branch 'alpine-install' of https://github.com/Wrong-Code/DnsSer…
Wrong-Code Apr 30, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
991 changes: 851 additions & 140 deletions APIDOCS.md

Large diffs are not rendered by default.

9 changes: 6 additions & 3 deletions Apps/AdvancedBlockingApp/AdvancedBlockingApp.csproj
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<Version>10.0</Version>
<Version>11.0</Version>
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
<Company>Technitium</Company>
<Product>Technitium DNS Server</Product>
Expand Down Expand Up @@ -39,6 +39,9 @@
<None Update="dnsApp.config">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="README.md">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>

</Project>
13 changes: 9 additions & 4 deletions Apps/AdvancedBlockingApp/App.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
Technitium DNS Server
Copyright (C) 2025 Shreyas Zare ([email protected])
Copyright (C) 2026 Shreyas Zare ([email protected])

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -43,6 +43,8 @@ public sealed class App : IDnsApplication, IDnsRequestBlockingHandler
{
#region variables

readonly static JsonDocumentOptions _jsonParseOptions = new JsonDocumentOptions() { CommentHandling = JsonCommentHandling.Skip };

IDnsServer? _dnsServer;

DnsSOARecordData? _soaRecord;
Expand Down Expand Up @@ -341,12 +343,15 @@ private static bool IsMatchFound(Dictionary<Uri, ListZoneEntry<RegexList>> regex

#region public

public async Task InitializeAsync(IDnsServer dnsServer, string config)
public async Task InitializeAsync(IDnsServer dnsServer, string? config)
{
_dnsServer = dnsServer;

if (config is null)
throw new InvalidOperationException();

Directory.CreateDirectory(Path.Combine(_dnsServer.ApplicationFolder, "blocklists"));
using JsonDocument jsonDocument = JsonDocument.Parse(config);
using JsonDocument jsonDocument = JsonDocument.Parse(config, _jsonParseOptions);
JsonElement jsonConfig = jsonDocument.RootElement;

_enableBlocking = jsonConfig.GetPropertyValue("enableBlocking", true);
Expand Down Expand Up @@ -1190,7 +1195,7 @@ private async Task<bool> DownloadListFileAsync()
{
HttpClientNetworkHandler handler = new HttpClientNetworkHandler();
handler.Proxy = _dnsServer.Proxy;
handler.NetworkType = _dnsServer.PreferIPv6 ? HttpClientNetworkType.PreferIPv6 : HttpClientNetworkType.Default;
handler.NetworkType = HttpClientNetworkHandler.GetNetworkType(_dnsServer.IPv6Mode);
handler.DnsClient = _dnsServer;

using (HttpClient http = new HttpClient(handler))
Expand Down
281 changes: 281 additions & 0 deletions Apps/AdvancedBlockingApp/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,281 @@
# Advanced Blocking App

A DNS App for [Technitium DNS Server](https://technitium.com/dns/) that provides advanced domain blocking capabilities with support for client-based group policies, multiple block list formats, and fine-grained control over blocking behavior.

## Overview

The Advanced Blocking App extends the DNS server's blocking capabilities by allowing administrators to:

- Create **client-based groups** with different blocking policies based on IP address, subnet, or local endpoint
- Use multiple types of block lists: domain lists, regex patterns, and AdBlock-style lists
- Configure custom blocking responses (NXDOMAIN or custom IP addresses)
- Set up allow lists to whitelist specific domains
- Map clients to groups using network addresses or DNS endpoint identifiers

## ⚠️ Important Warning: Overlap with Default Blocking

> **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.

## Installation

1. Open Technitium DNS Server web console
2. Navigate to **Apps** section
3. Click **App Store** and find the Advanced Blocking App to install
4. Configure the app by clicking on the **Config** button

## Configuration

The app is configured via a JSON configuration file (`dnsApp.config`). Below is a complete reference of all configuration options:

### Root 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 |

### Local Endpoint Group Mapping

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.

```json
"localEndPointGroupMap": {
"127.0.0.1": "bypass",
"192.168.10.2:53": "bypass",
"user1.dot.example.com": "kids",
"user2.doh.example.com:443": "bypass"
}
```

### Network Group Mapping

Maps client IP addresses or subnets to groups. More specific matches take precedence.

```json
"networkGroupMap": {
"192.168.10.20": "kids",
"192.168.10.0/24": "standard",
"0.0.0.0/0": "everyone",
"::/0": "everyone"
}
```

### Group Configuration

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 URL Formats

Block list URLs can be specified as simple strings or as objects with additional options:

**Simple format:**

```json
"blockListUrls": [
"https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts"
]
```

**Object format with custom options:**

```json
"blockListUrls": [
{
"url": "https://example.com/blocklist.txt",
"blockAsNxDomain": false,
"blockingAddresses": ["192.168.10.2"]
}
]
```

## Example Configuration

```json
{
"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": []
}
]
}
```

## Supported Block List Formats

### Domain Block Lists

Standard hosts-file format or plain domain lists:

```syslog
# Comment line
0.0.0.0 ads.example.com
127.0.0.1 tracking.example.com
malware.example.com
```

### Regex Block Lists

One regex pattern per line:

```regex
# Block all subdomains starting with "ads"
^ads\.
# Block tracking domains
.*tracking.*\.com$
```

### AdBlock Lists

Supports a subset of AdBlock syntax:

```regex
! Comment
||ads.example.com^
||tracking.example.com^$all
@@||safe.example.com^
```

## How Blocking Works

1. **Group Selection**: When a DNS request arrives, the app determines which group applies based on:
- First, local endpoint mapping (`localEndPointGroupMap`)
- Then, client IP/network mapping (`networkGroupMap`)
- More specific network matches take precedence

2. **Allow Check**: If the domain matches any allow list (static, URL-based, regex, or AdBlock whitelist), the request is NOT blocked.

3. **Block Check**: If the domain matches any block list, the app returns:
- `NXDOMAIN` if `blockAsNxDomain` is `true`
- Configured `blockingAddresses` for A/AAAA queries
- NO DATA response for other query types

4. **Blocking Report**: When `allowTxtBlockingReport` is enabled:
- TXT queries for blocked domains return metadata about why the domain was blocked
- EDNS Extended DNS Error option is included in responses

## Use Cases

1. **Parental Controls**: Create a "kids" group with stricter blocking for children's devices
2. **Guest Network**: Apply different policies to guest WiFi subnet
3. **IoT Isolation**: Block telemetry for IoT devices on a specific VLAN
4. **Multi-tenant DNS**: Different blocking policies for different clients sharing the same DNS server
5. **DoH/DoT Differentiation**: Apply different policies based on DNS transport protocol

## Troubleshooting

### Block lists not updating

- Check the DNS server logs for download errors
- Verify the URLs are accessible from the server
- Ensure the server has internet connectivity (or proxy configured)

### Domains not being blocked

1. Verify the client IP maps to the correct group
2. Check if the domain is in an allow list
3. Confirm `enableBlocking` is `true` at both root and group level
4. Review the group's block list configuration

### Testing blocking

Query a TXT record for a blocked domain from the client IP address to see the blocking report:

```bash
dig TXT blocked-domain.com @your-dns-server
```
6 changes: 3 additions & 3 deletions Apps/AdvancedBlockingApp/dnsApp.config
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
},
"networkGroupMap": {
"192.168.10.20": "kids",
"0.0.0.0/0": "everyone",
"[::]/0": "everyone"
"0.0.0.0/0": "everyone else",
"[::]/0": "everyone else"
},
"groups": [
{
"name": "everyone",
"name": "everyone else",
"enableBlocking": true,
"allowTxtBlockingReport": true,
"blockAsNxDomain": true,
Expand Down
11 changes: 7 additions & 4 deletions Apps/AdvancedForwardingApp/AdvancedForwardingApp.csproj
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<Version>4.0</Version>
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
<Version>5.0</Version>
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
<Company>Technitium</Company>
<Product>Technitium DNS Server</Product>
<Authors>Shreyas Zare</Authors>
Expand Down Expand Up @@ -41,6 +41,9 @@
<None Update="dnsApp.config">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="README.md">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>

</Project>
Loading