Commit graph

35 commits

Author SHA1 Message Date
世界
b19d4a92e2
Fix lint errors 2026-06-08 08:51:48 +08:00
世界
c8792e7fe6
dns: Add timeout configuration 2026-06-08 08:51:46 +08:00
世界
d218a1586a
Log DNS optimistic background refresh outcomes 2026-06-08 08:51:43 +08:00
世界
661075f693
Strip EDNS padding from upstream DNS responses 2026-06-08 08:51:42 +08:00
世界
0525f6cb1c
Add optimistic DNS cache 2026-06-08 08:51:40 +08:00
nekohasekai
9a3dcca616
Add evaluate DNS rule action and related rule items 2026-06-08 08:51:34 +08:00
世界
5e7fd7ad78
Fix lint errors 2026-05-13 23:39:27 +08:00
Berkay Özdemirci
5a957fd750
Fix EDNS OPT record corruption in DNS cache
The TTL computation and assignment loops treat OPT record's Hdr.Ttl
as a regular TTL, but per RFC 6891 it encodes EDNS0 metadata
(ExtRCode|Version|Flags). This corrupts cached responses causing
systemd-resolved to reject them with EDNS version 255.

Also fix pointer aliasing: storeCache() stored raw *dns.Msg pointer
so subsequent mutations by Exchange() corrupted cached data.

- Skip OPT records in all TTL loops (Exchange + loadResponse)
- Use message.Copy() in storeCache() to isolate cache from mutations
2026-04-10 14:08:24 +08:00
世界
4d6fb1d38d
Fix legacy DNS client_subnet options not working 2026-03-09 20:18:47 +08:00
世界
e62dc7bfa2
Fix rule_set_ip_cidr_accept_empty not working 2026-03-04 11:48:22 +08:00
世界
aba8346bd6
Fix DNS cache lock goroutine leak
The cache deduplication in Client.Exchange uses a channel-based lock
per DNS question. Waiting goroutines blocked on <-cond without context
awareness, causing them to accumulate indefinitely when the owning
goroutine's transport call stalls. Add select on ctx.Done() so waiters
respect context cancellation and timeouts.
2026-02-06 22:28:35 +08:00
世界
1ebff74c21
Fix DNS cache not working when domain strategy is set
The cache lookup was performed before rule matching, using the caller's
strategy (usually AsIS/0) instead of the resolved strategy. This caused
cache misses when ipv4_only was configured globally but the cache lookup
expected both A and AAAA records.

Remove LookupCache and ExchangeCache from Router, as the cache checks
inside client.Lookup and client.Exchange already handle caching correctly
after rule matching with the proper strategy and transport.
2025-12-21 16:59:10 +08:00
世界
36dc883c7c
Fix DNS negative caching to comply with RFC 2308 2025-10-09 23:45:23 +08:00
Mahdi
6557bd7029
Fix dns cache in lookup 2025-10-09 23:45:23 +08:00
世界
1955002ed8
Do not cache DNS responses with empty answers 2025-09-13 03:04:08 +08:00
世界
e81a76fdf9
Fix DNS exchange 2025-09-12 18:05:02 +08:00
世界
f98a3a4f65
Treat requests with OPT extra but no options as simple requests 2025-09-08 09:12:30 +08:00
世界
2594745ef8
Fix DNS client 2025-09-08 09:12:30 +08:00
世界
cc3041322e
Fix DNS cache 2025-09-08 09:12:30 +08:00
世界
c0dd4a3f07
Fix DNS reject check 2025-07-08 13:14:46 +08:00
世界
e586ef070e
Fix dns.client_subnet ignored 2025-07-08 13:14:43 +08:00
世界
6ee3117755
Add resolved service and DNS server 2025-07-08 13:14:41 +08:00
世界
f990630ccc
Fix set edns0 client subnet 2025-07-08 13:14:38 +08:00
世界
e7ef1b2368
Handle EDNS version downgrade 2025-07-08 13:12:35 +08:00
世界
349db7baec
Fix DNS lookup 2025-07-08 13:12:33 +08:00
k9982874
0c523980ff
Fix hosts DNS server 2025-07-08 13:12:24 +08:00
世界
9a5f69f435
Add fallback local DNS server for iOS 2025-07-08 13:12:18 +08:00
世界
3016338e34
refactor: DNS 2025-07-08 13:12:14 +08:00
世界
dc127e2994
Migrate components to library 2022-07-11 18:44:59 +08:00
世界
3c1190e2c3
Make dns.strategy take effect in dns exchange 2022-07-11 13:21:17 +08:00
世界
7f84191748
Minor fixes 2022-07-10 16:19:42 +08:00
世界
f448b6b977
Update gci format 2022-07-08 23:03:57 +08:00
世界
3699a57847
Add dial parallel for outbound dialer 2022-07-08 13:08:29 +08:00
世界
ecac383477
Add disableCache/disableExpire option for dns client 2022-07-06 23:43:20 +08:00
世界
8a761d7e3b
Add dns client 2022-07-06 23:14:19 +08:00