Commit graph

2638 commits

Author SHA1 Message Date
Frank Denis
504c287c19 Remove interface enumeration
Enumerating the interfaces is not free, especially on Windows where every
address lookup goes through the IP Helper service, so we sample slowly.

Losing a minute before rotating our client key after a network change is
harmless; burning CPU cycles every few seconds on an idle machine is not.
2026-08-06 23:00:58 +02:00
Frank Denis
c3ba78fac8 Simplify 2026-08-01 11:16:51 +02:00
Frank Denis
0acc6a57ad Add a test for #3305 2026-08-01 10:55:56 +02:00
Frank Denis
0de84ad05b Match suffix rules at label boundaries
Suffix rules are stored as-is, just reversed in a critbit trie.

So the longest prefix can end inside a DNS label, and hide a
shorter rule that actually matches the name.

To handle that and prevent adversarial names with many labels to
cause many repeated searches, we allowed only two lookups per match.
That was designed for common usage patterns, where names were
expected to be domain names, not host names.

But there's a clean way to prevent an unbounded number of matches
and properly match any rules: just append a dot to the stored suffix
keys (and reversed query names). It acts as a label separator, so
the longest prefix can find the specific valid suffix with as ingle
lookup.

Fixes #3305
2026-08-01 08:13:48 +02:00
Frank Denis
610904bba8 Improve portable network change detection 2026-07-30 12:00:18 +02:00
Frank Denis
8d88be1abb Improve autocloser workflow 2026-07-30 00:38:06 +02:00
Frank Denis
7532398830 PQ: pad resumed UDP queries to the regular question size target
Also discard oversized tickets and fall back to TCP when a query
cannot fit a datagram.
2026-07-22 23:13:58 +02:00
Frank Denis
8a3dde13ab Forwarding: only use TCP with bootstrap resolvers
Everything else is just sent to local devices, so UDP is fine.

Fixes #3295
2026-07-22 23:09:58 +02:00
Frank Denis
5d01beb6be Add the version number to the UI web pages 2026-07-19 12:34:45 +02:00
Frank Denis
458d2af16a Bump 2026-07-18 14:01:55 +02:00
Frank Denis
2d6e740e04 Improve examples 2026-07-18 13:39:00 +02:00
Frank Denis
f8cd9cb784 Real TCP queries dial a fresh connection every time 2026-07-18 13:30:54 +02:00
Frank Denis
085d0db346 Start benchmarking before Write(), not the setup time 2026-07-18 13:23:53 +02:00
Frank Denis
3770b529fe Stop counting PQ certs transfer time in the startup benchmark 2026-07-18 13:17:17 +02:00
Frank Denis
c11e884717 Support $PROXY in forwarding rules
Fixes #2441
2026-07-18 11:32:03 +02:00
Frank Denis
3c9e7bfe71 Update github actions 2026-07-18 10:50:02 +02:00
Frank Denis
960121007a Update miekg/dns 2026-07-18 10:41:31 +02:00
Frank Denis
a04d330c9f Fix PQ certificate fallback on fragmented UDP paths
Try the rollover-sized certificate query over UDP first and return as
soon as the small query succeeds so that a truncated response can
trigger TCP fallback instead of waiting for large UDP probes to time
out.

We keep relayed UDP packets at the intended size after accounting for
the Anonymized DNSCrypt header.

When retrying through a relay over TCP, retain a rollover-sized
inner query because the relay still forwards it to the resolver over
UDP and applies the anti-amplification thing.

Preserve the UDP RTT when TCP is used only to complete certificate
retrieval, so resolver latency does not incorrectly appear to be the
TCP fallback latency.
2026-07-18 10:30:08 +02:00
Frank Denis
ebd5d3c197 UI: limit the size of top domains map 2026-07-13 23:12:03 +02:00
Frank Denis
63203c36e2 Improve ODoH diagnostics 2026-07-13 23:09:03 +02:00
Frank Denis
37920d1b7b Update CodeQL action 2026-07-13 12:56:13 +02:00
Frank Denis
74b0aeca75 Sync deps 2026-07-13 12:55:13 +02:00
Frank Denis
211332c89c Update deps 2026-07-13 12:48:13 +02:00
Frank Denis
ed1843dcfb Bump 2026-07-13 12:40:13 +02:00
Frank Denis
75693da12c Mention that dnscrypt_servers also affects PQDNSCrypt 2026-07-13 12:31:13 +02:00
Frank Denis
04acb1a23d Reuse PQ key pairs 2026-07-13 12:24:13 +02:00
Frank Denis
77da353740 ephemeral key pairs are for X25519 2026-07-13 12:21:13 +02:00
Frank Denis
3e6f562d28 Update README.md to include PQ stuff 2026-07-13 12:18:13 +02:00
Frank Denis
f835e7ca24 Make pqdnscrypt a setting 2026-07-13 12:12:13 +02:00
Frank Denis
43bd97884e Validate ODoH padding length
Not really necessary, since responses are authenticated, but
useful to spot broken server implementations.
2026-07-13 12:05:13 +02:00
Frank Denis
f6baedbdeb local DoH: pad responses, not the incoming query 2026-07-11 14:22:46 +02:00
Frank Denis
c4e139350f resolveUsingResolver: don't return an error if we got some IPs
Even if this is not the full set of IPs.
2026-07-11 13:44:02 +02:00
Frank Denis
a7cb2c8fdc pattern matcher: test membership, not nil 2026-07-11 13:38:51 +02:00
Frank Denis
ff4898781c When using SOCKS + relay + a simple DNS exchange, send to the relay
Not to the server
2026-07-11 12:56:46 +02:00
Frank Denis
9bb7b8be0d lock source.refresh 2026-07-11 12:01:12 +02:00
Frank Denis
3ba850cf4b cache: include CD bit in the cache key 2026-07-11 11:59:36 +02:00
Frank Denis
4862bfe2ac Properly parse netprobe_timeout
flag.Int is never nil, so the flag's default value silently
overrode netprobe_timeout from the TOML file
2026-07-11 11:53:08 +02:00
Frank Denis
3c5dc7ec5b exchangeWithUDPServerViaProxy: on timeout, directly return an error
Instead of trying to decrypt junk (and then return an error, but
not the right one.
2026-07-11 11:51:58 +02:00
Frank Denis
6fb0980955 Initialize the DNS cache at plugin init time
No need for a lazily-created cache and sync.Once.
2026-07-10 12:22:52 +02:00
Frank Denis
8775802be5 Use cloneMsg instead of shallow Copy for cached DNS messages
miekg/dns/v2 Msg.Copy() only does a useless shallow copy of the RR
slices, so use cloneMsg instead.
2026-07-10 12:15:52 +02:00
Frank Denis
df3ba8e51f Add a helper funciton to clone (not copy) a dns message 2026-07-10 12:14:52 +02:00
Frank Denis
f41078a86a Update deps 2026-07-10 12:04:52 +02:00
Frank Denis
8bc23a4513 Update GitHub actions 2026-07-08 23:00:21 +02:00
Frank Denis
e7af9f2a3f Retry HTTP/3 after transient failures.
That will cause all DoH connections to block every
30 minute, but

Fixes #3258
2026-06-23 12:49:22 +02:00
Frank Denis
b9f971ea71 Rotate keys on IP changes also for classical dnscrypt 2026-06-22 23:04:46 +02:00
Frank Denis
c4144942e4 Watch for network changes and rotate PQ tickets when needed 2026-06-22 23:00:46 +02:00
Frank Denis
3f06406da1 Add new undelegated TLDs 2026-06-20 21:33:00 +02:00
Frank Denis
b5468f5a88 Pad certificate queries enough to retrieve PQ certs over UDP
An anonymized relay forwards certificate queries to the upstream
resolver over UDP only, and both the resolver and the relay refuse
to return a UDP response larger than the request that triggered
it.

A post-quantum certificate is about 1.3 KB, so a small certificate
probe came back truncated to the classical certificate alone, and
the proxy never learned that the resolver supported X-Wing when it
was reached through a relay.

Pad the large certificate probe well past the response size to fix
this.
2026-06-20 18:20:27 +02:00
Frank Denis
d164a54bcb Update deps 2026-06-19 23:07:38 +02:00
Frank Denis
106619984d go.mod: nove things round 2026-06-19 23:06:38 +02:00