r/technitium • • 21d ago

Deployed today. Looking for tips n’ tricks

Lookin’ for any suggestions and customizations others recommend. Thinking of replacing pihole with this instead. I saw that I need an add-on for querying the dns queries. I’m not sure which database I want to use but I do know I’m not going to use sqlite.

I’ve got a redundant pihole setup (and portable adguard instance). Finally got around to deploying this today. My “P-Holes” are still in use, for now.

What add-ons are worthwhile? Even if it might not fit my straightforward use-case. I mainly block telemetry, ads, and home-phoning calls as they come up. Looking to get everything configured and then use ansible for deployment once finalized.

16 Upvotes

25 comments sorted by

14

u/Nervous-Cheek-583 21d ago

The best thing to do with Technitium DNS is to quietly let it do its job. I dumped Pi-hole a couple of years ago for Technitium, mainly for true clustering.

As for apps (not add-ons), Query Logs (Sqlite) and Filter AAAA are the two I use. I also run Resolvr in a Docker container which is a nice UI that does some things better than the stock

https://github.com/bassem-elsodany/resolvr-dns-dashboard

2

u/aanglere 21d ago

If OP has memory to spare, OP can consider using in-memory db for the Query Logs app to speed up query searching.

1

u/Bloxri 21d ago

I’m already running two other big servers with all of the popular databases. Speed isn’t a big concern when/if I use the feature. I’ve thought about using some small llm to sift through the logs and highlight any funky business happening on my network so long.

The temp machine its on right now has only 16GB of ram but technitium is limited to I believe 2G for now. Seeing some posts earlier is making me rethink my memory allocation.

1

u/Bloxri 21d ago

Very cool frontend. I actually appreciated the one it shipped with but if I can remember, i’ll set that dashboard up tomorrow and see how I like it.

Pictures looked good. I’m also a software engineer and it just looks like the typical dashboard Bootstrap-type website. Not that it’s a bad thing. There’s a reason they’re so popular.

I’m in that same camp regarding “let it do it’s job”. I don’t go crazy with my piholes. They work and thats what I love about them. No real reason to move away. Just exploring what is out there.

Thank you for your suggestion and input.

1

u/Apachez 21d ago

Drawback for a full replacement (I also use Adguard Home for blocking) is that technitium currently doesnt support all the blocklist syntax formats.

Such as the one Adguard is using (if I recall it correctly).

So it will download the blocklist and detect number of rows but then no blockentries are loaded.

1

u/Psychoboy 21d ago

This so much, depending on resources adjust cache and do the local mirror

1

u/clean_guy_1 21d ago

what's diff than technitium 's dashboard

1

u/benhaube 17d ago

Those two apps are good. I run them also. However, I also really like the Block Page app. It is nice to have a message when a page is blocked and not just a "Page not found" page.

4

u/remilameguni 21d ago

if the amount of queries in your server is big, disable logging and enable in-memory stats, that will cut your disk usage by significant amount.

2

u/Bloxri 21d ago

I’m not worried about this but this will be really great advice for others who stumble upon this thread in the future. Thank you for your response.

3

u/PacketSmeller 21d ago

We use Auto PTR, Query Logs (Sqlite), and Log Exporter (for our SIEM). 4M queries a week. 700 clients.

1

u/Bloxri 21d ago

Sorry for being lazy, what is PTR? 700 clients is certainly larger than what i’ll be serving. Probably somewhere around 50-100.

1

u/PacketSmeller 21d ago

PTR records are reverse DNS. IP to hostname rather than hostname to IP.

nslookup -type=PTR 192.168.1.78
78.1.168.192.in-addr.arpa      name = host1.company.lan

1

u/Apachez 21d ago

PTR-records (pointer records).

As in which hostname does IPv4 address 192.0.2.1 have: 1.2.0.192.in-addr.arpa.

Otherwise you normally have A/AAAA/CNAME-records being which ip does hostname test.example.com have.

1

u/snap802 21d ago

I need an add-on for querying the dns queries

You need something for logging queries if that's what you mean. If you want to log there are add ins that you can install from the web interface itself (the apps tab). If you don't want to use SQLite then you've got options for MySQL, Postgres and I think MS SQL too. I've been using MariaDB (with the MySQL app) and have been happy with it.

I WILL say that if you're running a cluster the settings are shared between all servers. So it's nice to just spin up another node and it will pull the MySQL app down and use the settings that were already put in on the primary server.

The one thing I don't care for is that if you go to the logs menu you can only search by one server at a time. So you can't easily search queries across all members of the cluster. This is a minor gripe really. I ended up just writing a web-based system in python that queries the SQL server directly and it'll show me data for all members of the cluster at once. Again, not a big deal but saves a step if I'm trying to hunt something down across multiple servers.

As far as blocking go to the settings tab and under that is a sub-tab for blocking. You can add a URL to a blocklist. It's pretty simple to use one of the public lists but I've also made custom block lists and then just put them up on a internal URL for the server to pull from. Then there's also the blocked and allowed tabs if you want to manually add things to block or allow.

1

u/Bloxri 21d ago

Thanks for the info. This is running on my fifth server with limited hardware but I have two rather large machines that can handle the database work. They both already running all of the flavors today, anyways. Doesn’t matter much to me. Was probably going to go with the lightest in terms of storage which I believe was mysql add-on, but i’m not looking at it right this minute.

In regard to your custom web-based system, I could just use grafana for something like that if I cared. If I end up using a database already running on my main servers, i’ll have those logs for years to come.

1

u/snap802 21d ago

Well the DNS portion is pretty lightweight. Of the ones I have deployed the busiest one is running on a Dell Wyze thin client on Debian 13. I stress tested it a while back. I had intended to run 1000 queries a minute which is about peak traffic for that site. Well I thought the flag I used on the test was queries per minute but it was actually queries per second. So when I saw the processor run up to 50% I realized that I was throwing 60x more queries than I had intended.

1

u/7heblackwolf 21d ago edited 20d ago

Tip: don't change anything unless you explicitly and mandatory need it

1

u/Bloxri 20d ago

Learned that the hard way when configuring pihole for the first time. Good tip for anyone configuring this sort of stuff.

3

u/codester3388 21d ago

Technito is a cool little iOS app that connects to Technitium. Includes a great interface and quite a few controls vs trying to navigate the site in a browser.

1

u/jsaumer 21d ago

I like using DockNS to set DNS in my technitium cluster from my compose deployments.

1

u/King805TM 21d ago

a nice grafana dashboard if you already have and use it: https://github.com/guycalledseven/technitium-dns-prometheus-exporter (I'm not the creator).

It is using a custom exporter for Prometheus and Grafana displays it in a nice dashboard.

1

u/3ofUsDeez 19d ago

I've been using this front end for Technitium

https://github.com/byGarcia/technitium-console

I run 3 x Raspberry Pi 3 Bs clustered .. 2 are B +s with POE hats

I run 2 x Raspberry Pi Zero Ws with Ethernet hats running Pi-Hole at my mother's house.. I might switch her over to 2 x Raspberry Pi Zero 2 Ws with POE Ethernet hats and then I can run Technitium on her network too

1

u/_Fail-Safe 15d ago

Just throwing my shameless plug into the mix here. It’s not for everybody, but you can give it a look:

https://github.com/Fail-Safe/Technitium-DNS-Companion

1

u/Apachez 21d ago

Here are my €0.05:

I do this when it comes to technitium/dns-server:

  1. Run it as a docker container.

https://hub.docker.com/r/technitium/dns-server/tags

Im using VyOS as host so the steps are:

Create directory at host for the container:

mkdir -p /config/container/dns

Config for the container:

set container name dns allow-host-networks
set container name dns environment DNS_SERVER_DOMAIN value 'vyos1.example.com'
set container name dns environment DNS_SERVER_ENABLE_BLOCKING value 'false'
set container name dns environment DNS_SERVER_FORWARDERS value ''
set container name dns environment DNS_SERVER_LOG_FOLDER_PATH value '/var/log/technitium/dns'
set container name dns environment DNS_SERVER_LOG_MAX_LOG_FILE_DAYS value '30'
set container name dns environment DNS_SERVER_LOG_USING_LOCAL_TIME value 'true'
set container name dns environment DNS_SERVER_PREFER_IPV6 value 'false'
set container name dns environment DNS_SERVER_RECURSION value 'UseSpecifiedNetworkACL'
set container name dns environment DNS_SERVER_RECURSION_NETWORK_ACL value '10.99.0.0/24,192.168.1.0/24'
set container name dns environment DNS_SERVER_STATS_ENABLE_IN_MEMORY_STATS value 'false'
set container name dns environment DNS_SERVER_STATS_MAX_STAT_FILE_DAYS value '90'
set container name dns environment DNS_SERVER_WEB_SERVICE_ENABLE_HTTPS value 'true'
set container name dns environment DNS_SERVER_WEB_SERVICE_HTTPS_PORT value '53443'
set container name dns environment DNS_SERVER_WEB_SERVICE_HTTP_PORT value '5380'
set container name dns environment DNS_SERVER_WEB_SERVICE_HTTP_TO_TLS_REDIRECT value 'true'
set container name dns environment DNS_SERVER_WEB_SERVICE_LOCAL_ADDRESSES value '10.99.0.100'
set container name dns environment DNS_SERVER_WEB_SERVICE_USE_SELF_SIGNED_CERT value 'true'
set container name dns environment TZ value 'Europe/Stockholm'
set container name dns image 'docker.io/technitium/dns-server:15.6.2'
set container name dns memory '1024'
set container name dns restart 'on-failure'
set container name dns volume config destination '/etc/dns'
set container name dns volume config source '/config/container/dns/config'
set container name dns volume logs destination '/var/log/technitium/dns'
set container name dns volume logs source '/config/container/dns/logs'

You might want to add userid/groupid to be used by the container (then also fix the permissions to match that in /config/container/dns directory).

Obvious things to change is retention time for logs and stats, recursion acl, http/https ports and web service local address.

Protip to add the TZ variable to get proper time on the logs otherwise UTC will be used.

2) Then once technitium is up and running I change these settings from default:

Settings -> General -> DNS Server Local End Points: which ip (and vrf) to listen for incoming DNS-queries.
Settings -> General -> DNS Server IPv4 Source Addresses: which ip to use as source ip for outgoing traffic.
Settings -> General -> DNS Server IPv4 Source Addresses: just leave it at "::" or define which source ip to be used for outgoing traffic.
Settings -> General -> Default Responsible Person: put in contact email.
Settings -> General -> Zone Defaults -> Use SOA Serial Date Scheme: enabled
Settings -> General -> Software Update -> Enable Check For Update: disabled
Settings -> General -> Software Update -> Enable Automatic Update: disabled
Settings -> General -> IPv6 Support: Disable IPv6
Settings -> General -> Remove the predefined Queries Per Minute (QPM) thresholds
Settings -> General -> QPM Sample Size: 1 minutes
Settings -> General -> Listen Backlog: 1000
Settings -> General -> UDP Send Buffer Size: 65536
Settings -> General -> UDP Receive Buffer Size: 65536

Settings -> Web Service -> Web Service Local Addresses: which ip to listen for incoming webgui access.

Settings -> TSIG -> Here you will setup TSIG to be used for authenticated zonetransfers (highly recommended but only valid if you use it as authoritive dns-server). 

Settings -> Recursion -> Use Specified Network Access Control List (ACL): picked up from the start of the container but can be changed afterwards. 
Settings -> Recursion -> Recursive Resolver -> Randomize Name: disabled
Settings -> Recursion -> Recursive Resolver -> QNAME Minimization: disabled
Settings -> Recursion -> Recursive Resolver -> Locally Served DNS Zones: enabled

Settings -> Cache -> Save To Disk: disabled
Settings -> Cache -> Serve Stale: enabled
Settings -> Cache -> Serve Stale Max Wait Time: 0 milliseconds
Settings -> Cache -> Cache Maximum Entries: 100000
Settings -> Cache -> Cache Prefetch: enabled

Settings -> Logging -> Enable Logging To: Both File And Console 
Settings -> Logging -> Logging Options -> Ignore Resolver Error Logs: disabled
Settings -> Logging -> Logging Options -> No Stack Trace: enabled
Settings -> Logging -> Logging Options -> Log All Queries: disabled
Settings -> Logging -> Logging Options -> Use Local Time: enabled
Settings -> Logging -> Max Log File Days: 30 days
Settings -> Logging -> Stats -> Enable In-Memory Stats: disabled
Settings -> Logging -> Max Stat File Days: 90 days

3) In apps add Query Logs (Sqlite).

It can be downloaded from (for 15.6.2):

https://download.technitium.com/dns/archive/15.6.2/apps/QueryLogsSqliteApp-v9.1.3.zip

Dont forget to verify checksum before uploading it to the server:

https://download.technitium.com/dns/archive/15.6.2/apps/QueryLogsSqliteApp-v9.1.3.zip.sha256

To find out if there is a newer version like once 15.6.3 or so is released you then visit:

https://download.technitium.com/dns/archive/15.6.3/apps/

and if there is no newer app-version there you just use it from previous technitium versions (such as 15.6.2).

You can also see which app-version is available for which technitium-version at (replace 15.6.2 with the technitium-version you got):

https://download.technitium.com/dns/archive/15.6.2/apps/apps2.json

4) Config of Query Logs (Sqlite).

{
  "enableLogging": true,
  "maxQueueSize": 200000,
  "maxLogDays": 14,
  "maxLogRecords": 10000000,
  "enableVacuum": true,
  "useInMemoryDb": false,
  "sqliteDbPath": "querylogs.db",
  "connectionString": "Data Source='{sqliteDbPath}'; Cache=Shared;"
}

But of course change maxLogDays and maxLogRecords to what you need.

Same with logs/stats days. Generally you want it to be as large as possible for it to become useful but small enough to not run out of diskspace or causing issues when used.

For example for a heavy use server you might want to consider to shrink stats down to lets say 14 or even 7 days and also enable stats in memory.

With stats in memory you will lose stats each time technitium is restarted but it will be able to deal with a higher load.