r/dnscrypt • • Dec 15 '20

dnscrypt-proxy logs to prometheus

27 Upvotes

Hello there,

I've wanted to export dnscrypt-proxy related metrics to my local prometheus installation for a while but I couldn't find anything working out the box, so here's the little recipe I came up with. I hope it can be useful to others.

It uses mtail, which extracts metrics from logs based on a "program" file, and exposes or pushes them to different monitoring systems

Here's what it looks like once the data is fed in Prometheus and queried via Grafana:

Prerequisites

  • dnscrypt-proxy running with query_log enabled and format set to ltsv

  • mtail installed on your machine

mtail recipe

All the magic happens here, it parses DNSCrypt-proxy's query_log and generates the following metrics:

  • Total number of processed queries

  • Number of queries by client host, query type, return code, remote server and if it comes from the cache

  • Histogram of the latency for each server, return code and query type (buckets will need adjustment depending on the latency you have with the upstream DNSCrypt servers)

# mail "program" for DNSCrypt's query log (in ltsv format)
#
# Sample line:
#  time:1608044190 host:127.0.0.1  message:www.ripe.net    type:A  return:PASS                                                                       cached:0        duration:1      server:faelix-ch-ipv4

counter queries_total
counter queries by host, type, return, cached, server

# Binning should be adapted to the latency (in ms) you have with your DNSCrypt s                                                                  ervers
histogram queries_duration_ms buckets 1, 2, 4, 8, 16, 32, 64, 128, 256 by return                                                                  , server, type

/^/ +
/time:[0-9]+\s+/ +
/host:(?P<host>\S+)\s+/ +
/message:(?P<message>\S+)\s+/ +
/type:(?P<type>\S+)\s+/ +
/return:(?P<return>\S+)\s+/ +
/cached:(?P<cached>[0-1])\s+/ +
/duration:(?P<duration>[0-9]+)\s+/ +
/server:(?P<server>\S+)/ +
/$/ {
  queries_total++
  queries[$host][$type][$return][$cached][$server]++

  # Only consider non-cached results for histograms
  $cached == 0 {
     queries_duration_ms[$return][$server][$type] = $duration
  }
}

Test of the recipe

mtail comes with two modes to ensure your "program" compiles properly, and also that it generates the expected metrics

  • Validation of the "program"

$ mtail --compile_only --progs /etc/mtail/dnscrypt.mtail
  • Test metrics generation with an existing logfile, it should print a huge JSON structure.

$ mtail --one_shot --progs /etc/mtail/dnscrypt.mtail --logs /var/log/dnscrypt-proxy/query.log
[...]
  "queries_total": [
    {
      "Name": "queries_total",
      "Program": "dnscrypt.mtail",
      "Kind": 1,
      "Type": 0,
      "LabelValues": [
        {
          "Value": {
            "Value": 2290,
            "Time": 1608062896300824001
          }
        }
      ]
    }
  ]
}

Next steps


r/dnscrypt • • Aug 16 '21

Recordings of the sdns://2021 event are available

Thumbnail
youtube.com
10 Upvotes

r/dnscrypt • • 7d ago

DNSCrypt-Proxy 2.1.21 Released

15 Upvotes

Version 2.1.21

  • Wildcard UDP listeners now reply from the address that received the query on platforms that support UDP packet information.

  • Fixed IPv6 relay selection for wildcard Anonymized DNSCrypt routes.

  • Cloaking now creates PTR records for all IPv6 addresses of a cloaked name.

  • The monitoring dashboard accepts ws and wss in X-Forwarded-Proto when served behind a reverse proxy.

  • Forwarded replies with a mismatched DNS question are rejected instead of falling back to regular resolvers.

  • Changed the default network probe and fallback bootstrap address to 8.8.8.8:53. The example bootstrap list now uses Google and Cloudflare.

  • Added the NetAPI compromised domains list to the blocklist generator.

Known issue: macOS binaries are not notarized.


r/dnscrypt • • 9d ago

Does splitting domains across registarars affect repution like at all??

1 Upvotes

Building a small dapp. Test build on a railway subdomain got flagged by wallets with the usual new domain, possible phishing warning, and I want to avoid that carrying onto production.

While sorting it I realised our domains are a mess. Main one in one account, ,I am currently settled with Wix, a couple of defensive registrations somewhere else, and the staging name on a third. Nobody’s audited which is which in months.

So two questions really. Does consolidating them under one registrar do anything for trust signals, or is that entirely about age and traffic and nothing to do with where the domain


r/dnscrypt • • 11d ago

moving off proton and google, where does the domain side fit into this

0 Upvotes

Shifting off Proton after the recent mess and still slowly degoogling. Mail and calendar run on my own box now, drive is about half done.

The part I didn’t think through is the domain. Parked at Wix since I registered it years back and I’ve never touched the DNS beyond pointing it once. Now that mail is self hosted I suddenly care a lot about where those records live, and everyone says Cloudflare for DNS.

Also want to get the domain privacy protection sorted properly while I’m in there, since my actual name and address being in a public lookup rather defeats the point of the whole exercise.

Worth moving the registration or just the DNS? And for anyone who’s done it, what broke on the way


r/dnscrypt • • 18d ago

DNSBunker: Certificate hash not found (IPv4 and IPv6)

5 Upvotes

I'm experiencing a certificate verification error when connecting to DNSBunker using `dnscrypt-proxy`.

Both IPv4 and IPv6 resolver entries fail with the same error:

[CRITICAL] [dnsbunker] Certificate hash [b4e0a8c98b0aae43b7383037accd11a1c964971f6b74fcbc370cd030fb328ddd] not found
[CRITICAL] [dnsbunker-ipv6] Certificate hash [b4e0a8c98b0aae43b7383037accd11a1c964971f6b74fcbc370cd030fb328ddd] not found

What I've found so far:

The server successfully responds to the TLS handshake.

The certificate returned by the server has a different hash (`32f42b...`) than the one expected by the resolver stamp (`b4e0a8...`).

Both IPv4 and IPv6 endpoints appear to return the same certificate chain.

The issue therefore appears to be related to a certificate/stamp mismatch rather than an IPv4 or IPv6 connectivity problem.

Questions:

  1. Has the DNSBunker certificate recently been renewed or changed?

  2. Is the published DNSCrypt stamp outdated?

  3. Should the resolver stamp be updated, or could there be another explanation for this error?

I'd appreciate any insights from the DNSCrypt community or the DNSBunker operator.

Thanks!


r/dnscrypt • • Oct 24 '26

DNSCrypt-Proxy 2.1.20 Released

20 Upvotes

Version 2.1.20

  • Name lists now support regex: rules for matching domain names with regular expressions.

  • Added doh_check_cert_hashes_on_connect to optionally check DoH certificate hashes from DNS stamps on every new connection, rather than only during probes.

  • Fixed PQDNSCrypt TCP padding and padding delimiter handling.

  • Network change detection now ignores non-global addresses.

  • HTTP/3 DNS responses are now limited to 4 KB.

  • Network probes now support multiple comma-separated addresses.


r/dnscrypt • • Oct 22 '26

DNSCrypt-Proxy 2.1.19 Released

13 Upvotes

Version 2.1.19

  • Resumed PQDNSCrypt queries now use regular UDP padding, protecting their size and response budget. Oversized tickets are rejected, and oversized queries fall back to TCP.

  • Network changes are detected more reliably, ensuring PQDNSCrypt key material rotates when connections change.

  • Forwarded queries to local or DHCP resolvers now use UDP by default. Bootstrap resolvers still use TCP when force_tcp is enabled.

  • Suffix rules now match only at DNS label boundaries. IP allow/block rules now correctly handle IPv4-mapped IPv6 addresses.

  • The monitoring dashboard displays the running version. Its endpoints no longer allow cross-origin browser access.


r/dnscrypt • • Oct 20 '26

eMudhra Intermediate CA Compromise

Thumbnail emudhra.we-have-a-problem.com
11 Upvotes

The private keys of eight eMudhra intermediate CA certificates have been compromised.

They chain to roots trusted by the Mozilla, Microsoft, Apple and Chrome root programs and by many downstream trust stores.


r/dnscrypt • • Sep 17 '26

Critical Unbound DNSSEC Validator Flaw Could Allow RCE via a Malicious DNS Zone

Thumbnail
thehackernews.com
13 Upvotes

Server operators, update your Unbound instance!

New dnscrypt-server-docker images are also available.​


r/dnscrypt • • Aug 27 '26

Use DoH in bootstrap_resolvers

2 Upvotes

Hello, I'm running into an issue (or maybe a limitation) with dnscrypt-proxy.

Recently, I came across a network behind a firewall where port 53 (both TCP and UDP) is blocked. I don't know exactly why, probably to force users to use the system DNS provided by the firewall/gateway. Port 9953 for Quad9 happens to be open, but this seems more like a misconfiguration than a deliberate policy (traffic is apparently being filtered by port rather than only allowing explicitly permitted ports). In a properly configured restrictive network, both 53 and 9953 could be blocked. Since 443 has to remain open if I want to access the web, using HTTPS/443 seems like the only reliable bootstrap path.

If I set something like 9.9.9.9:443 in bootstrap_resolvers, dnscrypt-proxy sends a plain DNS query to port 443 rather than using DoH. Since Quad9 expects HTTPS/DoH on 443, the query fails. I verified this with tcpdump: UDP/443 gets no response, while TCP/443 completes the handshake, receives the plain DNS payload, and then closes the connection. Falling back to the system resolver doesn't help either, because /etc/resolv.conf points to 127.0.0.1 in order to ensure that normal system DNS queries go through dnscrypt-proxy. I've looked through the documentation, but I couldn't find a way to use DoH for bootstrap resolvers (or for the initial network/source resolution).

Is there currently a way to use DoH for the initial bootstrap, ideally using an IP address directly so that no DNS resolution is required first? The goal is to make the bootstrap reliable on networks where TCP/UDP 53 (and potentially alternative DNS ports such as 9953) are blocked, as long as HTTPS/443 is available.

I use DNSCrypt-proxy 2.1.18.


r/dnscrypt • • Aug 20 '26

v21.1.18 Is Out

Thumbnail
github.com
12 Upvotes

r/dnscrypt • • Aug 16 '26

How to contribute on github?

3 Upvotes

I'm genuinly asking this question because I see that opening a new issue, a new PR or even just partecipate in discussions on github is actually limited to "users that have contributed to this repository in the past".

So how can I contribute to the project?


r/dnscrypt • • Aug 03 '26

Windows Defender false alarm

Post image
6 Upvotes

A Windows Defender warning popped up after a recent definition update. I’ve been using DNSCrypt-Proxy v2.1.18 since its release day and downloaded from official github.
I know this is a false positive—just wanted to give a heads-up


r/dnscrypt • • Jul 17 '26

How to add time based blocklist into invizible pro

3 Upvotes

I recently downloaded invizible pro hoping I can block every site ( kind of like cutting internet across the entire phone) for a specific interval of time but I can't add a blocklist into it or rather even after adding, it doesn't work. For eg I added youtube. @time-to-sleep into the add rule option in pattern based blocklist but nothing happens. Can anybody help me with this. I also tried integrating schedule = 'restrict' command directly into the dnscrypt proxy toml but the app crashes and asks me to reset. Btw I use poco m6 not rooted


r/dnscrypt • • Jun 23 '26

PQDNSCrypt server software and docker images are ready

9 Upvotes

encrypted-dns-server now includes supports for post-quantum DNSCrypt (PQDNSCrypt).

The docker image has also been updated to serve PQDNSCrypt in addition to DNSCrypt automatically.

If you are running a DNS server, you can already update before a new release of dnscrypt-proxy that includes PQDNSCrypt is out.


r/dnscrypt • • Jun 21 '26

How hard is it to block DNSCrypt, from an ISP perspective?

7 Upvotes

Blocking/spoofing standart DNS is extremely easy we all know that, and DNS over TLS/QUIC uses port 853 which again could be easily blocked. DNS over HTTPS is over port 443, but can still be blocked with deep packet inspection by checking the SNI (assuming that its not encrypted, and even if it is it can still get decrypted during the initial handshake). Which only leaves DNSCrypt. So from an ISP/Government perspective how hard is it to block DNSCrypt traffic? (not counting manually blocking IP addresses as thats cheating) Few years ago before my ISP implemented deep packet inspection, they used to hijack port 53, and also blocked all DoH/DoT providers. But DNSCrypt used to work and I've been curious about it since.


r/dnscrypt • • Jun 19 '26

DNS

0 Upvotes

I need the best free no subscription dns app for iOS


r/dnscrypt • • Jun 17 '26

Post-quantum DNSCrypt

Thumbnail ietf.org
9 Upvotes

r/dnscrypt • • Jun 08 '26

Made a pfSense package for dnscrypt-proxy with a full GUI

7 Upvotes

If you've ever run dnscrypt-proxy on pfSense, you know the drill: install it from the terminal, then live in the TOML file over SSH for every little change. I did that for years. It always bugged me that such a great tool had no real home on the platform, so I built one: a pfSense package that gives dnscrypt-proxy a complete GUI.

It supports the full protocol set: DNSCrypt v2, DoH, ODoH, and Anonymized DNS with relay routing. Highlights:

  • Server selection from pre-configured providers, or add your own via DNS stamps

  • Anonymized DNS relay routing configurable from the UI

  • Block/allow lists, forwarding, cloaking

  • Query log viewer with filtering

  • Load balancing strategies, HTTP/3 (QUIC), ephemeral keys, cache TTL controls

  • Any option not in the UI goes in as custom TOML, validated with dnscrypt-proxy -check before save

The upstream binary is minisign-verified against the official DNSCrypt key in CI before it's ever committed, and releases carry build provenance.

This is a small way of giving back to a project I've relied on for a long time, and hopefully it makes dnscrypt-proxy easier to run for the pfSense crowd. Feedback is very welcome.

Repo: https://github.com/nopoz/pfsense-dnscrypt-proxy

A star is appreciated if you find it useful. And a genuine thank you to Frank Denis (jedisct1) and everyone who contributes to dnscrypt-proxy - this package only exists because you built something worth wrapping a GUI around!


r/dnscrypt • • Jun 04 '26

Difficulties with Fedora

1 Upvotes

So, I recently installed Bazzite to get myself off of Windows, and added DNSCrypt-proxy to the mix. it was great, then my computer fully powered off at random and, when i booted it back up, the entire DNS side of things was broken. After some troubleshooting, i managed to fix it by adding 8.8.8.8 as a DNS on the resolv.conf. which is great, but now the whole DNSCrypt side isn't really working. has anybody had a similar problem? perhaps even resolved it?


r/dnscrypt • • May 24 '26

dnscrypt-proxy 2.1.16 released!

Thumbnail github.com
16 Upvotes

r/dnscrypt • • May 20 '26

Unbound: Possible arbitrary code execution during DNSSEC validation, Crash during DNSSEC validation of malicious content, NSEC3 issues, cache poisoning, and other fun CVEs.

Thumbnail
nlnetlabs.nl
14 Upvotes

r/dnscrypt • • May 20 '26

Geaux - DNSCrypt availability on ios.

5 Upvotes

https://testflight.apple.com/join/dQbw7aDW

Still in Beta, but i could use some help finding bugs.