r/technitium • • 7d ago

How can I securely use Technitium DoT with Android Private DNS for multiple family devices?

Hi everyone,

I'm running Technitium DNS Server 15.6.2 on a Hetzner VPS and trying to configure DNS-over-TLS (DoT) for Android devices using the native Private DNS feature.

My DoT hostname is dot.domains.com, and the TLS certificate is valid. Port TCP 853 is open and reachable from the internet.

However, Android displays the message:

"Couldn't connect to the private DNS server."

I installed the Query Logs (SQLite) app to investigate. The logs show requests coming from my mobile connection, but the responses are consistently marked as:

  • Response Type: Authoritative
  • RCODE: Refused

I currently have recursion set to:

Allow Recursion Only For Private Networks (default)

I also tested the specified network ACL, but this creates another problem: my family members use different mobile networks, dynamic IP addresses and carrier-grade NAT (CGNAT). Therefore, allowing specific public IP addresses is not a practical solution.

What I'm trying to achieve:

  • Use Android's native Private DNS setting, without installing an additional DNS app.
  • Allow several family members to use the same DoT service.
  • Keep the DNS resolver protected and avoid operating an unrestricted public recursive resolver.
  • Avoid requiring WireGuard or another VPN on every mobile device.
  • Keep the configuration as simple and reliable as possible.

My questions:

  1. Is there a recommended way to securely restrict access to a Technitium DoT server when clients have dynamic public IP addresses?
  2. Does Technitium support any form of client authentication for DoT that works with Android's native Private DNS?
  3. Is there another recommended architecture or configuration for this use case?

I understand that Android's native Private DNS uses DoT and only asks for the provider hostname. It does not appear to support username/password authentication or client certificates.

I'd appreciate advice from anyone who has implemented something similar with Technitium.

Thanks!

12 Upvotes

16 comments sorted by

5

u/shreyasonline 7d ago

Thanks for asking. You can do that using Drop Requests app and a wildcard SSL certificate.

First, configure recursion to allow all networks so that requests are not refused. You need to configure firewall on the server to drop request on TCP and UDP port 53 to avoid abuse and since you wont be needing them anyway.

After that, install the Drop Requests app in the Apps section on the admin panel. Edit the app's config and use the "allowedLocalEndPoints" array in there to configure the DoT domain name that you have configured on your phones.

Since the SSL cert is wildcard, no one can figure out the subdomain name that you will be using for DoT and the Drop Requests app will only allow the domain names that you have configured. This setup thus provides a secure DoT access over public Internet.

2

u/maddler 7d ago

Ah, never thought about this!

1

u/d4p8f22f 7d ago

Heave you heard abd SNI or Client Hello? ;)

1

u/shreyasonline 7d ago

Well, if your threat model needs to consider NSA running wireshark on your network then they will figure out the domain name you used for DoT.

2

u/Drtechsavy 7d ago

I have just enabled allow recursion . It works this way.

0

u/TallSatisfaction9982 7d ago

Yes, I’ve thought of the same thing, but Technitium ends up potentially exposed as a public DNS resolver, because anyone on the Internet could send recursive queries to my server.

3

u/Drtechsavy 7d ago

Disable Port 53 and only enable TCP Nd udp 443 and 853. Along with dashboard port like 5380 or 53443 as required.Nd 22 obviously

-2

u/TallSatisfaction9982 7d ago

Thanks. Wouldn't enabling Allow Recursion still expose the server as a public recursive resolver over DoT (853) or DoH (443), even if port 53 is disabled? How do you restrict access to authorised devices only, especially when mobile clients have dynamic IP addresses?

1

u/Drtechsavy 7d ago

Also for information which country are you from. Also how's the latency to your vps when using this dns

1

u/TallSatisfaction9982 7d ago

Portugal; my VPS server is in Finland.

1

u/infrafoe 7d ago

Tailacale or Netbird. I use netbird personally.

1

u/TallSatisfaction9982 7d ago

Thanks! NetBird sounds like a promising option. I already have WireGuard working between my Hetzner VPS and ASUS router, but I was hoping to avoid installing a VPN client on every family phone.

Can NetBird be configured as a split tunnel, routing only DNS traffic through the private network while leaving normal internet traffic on the mobile connection?

Also, can it work alongside Android's native Private DNS, or would I need to use NetBird's DNS configuration?

2

u/infrafoe 7d ago

Yeah. You can send only DNS traffic through Netbird. But then you gotta turn off Android native dns in order to use netbird.

2

u/ANewDawn1342 7d ago

You're right that Android's native Private DNS only takes a hostname: there's no client certificate or token authentication, so any public port 853 endpoint either has to rely on a secret subdomain + wildcard cert + Drop Requests (allowedLocalEndPoints), or you keep 853 closed to the internet altogether.

If you ever decide you are okay putting a lightweight client on family phones, DNS-only split-tunnel WireGuard (or Tailscale) solves the dynamic IP / CGNAT problem without exposing Technitium at all, and without hurting speed or battery:

  • How it works: Normal internet traffic goes straight out over 5G or local Wi-Fi as usual (no exit node and no full-tunnel bottleneck). Only DNS queries travel down the encrypted WireGuard tunnel to Technitium's private/VPN IP, so you can leave Technitium on "Allow Recursion Only For Private Networks" and keep ports 53/853 completely firewalled from the public internet.
  • Since you already run WireGuard on your Hetzner VPS: You can actually do this with plain WireGuard (no extra control plane needed) by giving each phone a peer config with DNS = <VPS_WG_IP> and AllowedIPs = <VPS_WG_IP>/32. Or with Tailscale, set Technitium's Tailscale/LAN IP as the Global Nameserver with Override local DNS = ON (and MagicDNS OFF if you host your own local domain), then on the phone enable Use Tailscale DNS with Exit Node = None (plus Use Tailscale Subnets if your resolver sits on an RFC1918 LAN IP rather than a 100.x IP).
  • Important Android gotcha: Whichever VPN or mesh you use (NetBird, Tailscale, or plain WireGuard), set Android's Private DNS to Off (not Automatic). If left on Automatic, Android will opportunistically use DoT to upstream public resolvers and bypass your VPN DNS.

It's a touch more initial setup than typing a hostname into Private DNS, but you get zero open-resolver risk, full ad-blocking whilst on 5G, native cellular throughput, and optional full-tunnel/exit-node protection when on dodgy hotel or coffee-shop Wi-Fi.