Commit Graph
66 Commits
Author SHA1 Message Date
TWO666 fb002210ff fix: tun dns hijack sending zero-filled or stale packets when PackBuffer reallocates (#3037)
D.Msg.PackBuffer sizes its scratch space by the uncompressed message length
and silently allocates a new slice when that exceeds the given buffer, even
though the compressed result would fit. The udp hijack path in
listener/sing_tun/dns.go always sends the original buffer, producing a
correct-length datagram full of zeros or stale bytes whenever a reply's
uncompressed size exceeds SafeDnsPacketSize (e.g. 100+ A records for one
name). Copy the packed result back into the caller's buffer when it fits.
The tcp path in RelayDnsConn already guards against this; the udp path did
not.
2026-07-27 13:03:03 +08:00
wwqgtxx 022f677385 chore: cleanup hostValue code 2026-02-07 12:07:01 +08:00
wwqgtxx 40e0813869 chore: adjust the internal code structure of the dns module 2025-09-29 11:24:41 +08:00
wwqgtxx 5f1f296213 chore: add /cache/dns/flush to restful api 2025-07-27 12:30:33 +08:00
phanium 91985c1ef8 chore: typo (#2127) 2025-06-26 07:45:46 +08:00
wwqgtxx 939e4109d7 chore: write dns reply in single syscall 2025-06-07 00:38:39 +08:00
wwqgtxx c0f452b540 chore: more unmap for 4in6 address 2025-05-29 10:14:06 +08:00
wwqgtxx c6d7ef8cb8 feat: add ech-opts for anytls/shadowsocks/trojan/vmess/vless outbound 2025-05-17 13:53:21 +08:00
HiMetre 7a260f7bcf fix: udp dial support ip4p (#1377) 2025-04-11 09:20:58 +08:00
wwqgtxx b2d2890866 chore: cleanup resolveUDPAddr code 2025-04-09 18:02:12 +08:00
wwqgtxx c63a851bba feat: add direct-nameserver and direct-nameserver-follow-policy in dns section 2024-10-04 14:20:10 +08:00
wwqgtxx 4a16d22398 chore: no longer used net.DefaultResolver when dns section is disabled, now is equally only "system://" 2024-10-02 14:45:06 +08:00
wwqgtxx acfc9f8baa chore: reset resolver's connection after default interface changed 2024-09-27 20:36:00 +08:00
wwqgtxx 0a2f606e1b chore: cleanup the patch code 2024-09-11 16:10:49 +08:00
wwqgtxx 39eda257a7 chore: replace zhangyunhao116/fastrand to our metacubex/randv2 2024-05-31 13:07:48 +08:00
wwqgtxx 30a913aad6 chore: stop using go:linkname for net.lookupStaticHost 2024-05-18 20:45:15 +08:00
xishang0128 5dd883e790 chore: Add use-system-hosts option 2024-05-06 14:03:29 +08:00
wwqgtxx d84f88b50f fix: system:// should ignore dns server setting by tun listener 2024-04-13 08:02:43 +08:00
wwqgtxx bd703b8ff2 fix: truncate dns message in udp response
https://github.com/MetaCubeX/mihomo/issues/1168
2024-04-09 14:16:09 +08:00
wwqgtxx 11f0983e5c fix: resolve by ProxyServerHostResolver should not retry with DefaultResolver when error occurs 2024-03-28 23:33:56 +08:00
wwqgtxx b3db113b1b chore: allow disabled system hosts by environment variable DISABLE_SYSTEM_HOSTS 2024-03-13 15:32:26 +08:00
wwqgtxx fad1a08378 chore: dns outbound support tcp 2024-03-07 13:12:40 +08:00
wwqgtxx 8b9813079b chore: share RelayDnsPacket function code 2024-03-04 22:12:27 +08:00
wwqgtxx 17c9d507be chore: hello mihomo 2023-11-03 21:58:21 +08:00
wwqgtxx 0207a7ac96 chore: resolver read system hosts file 2023-09-23 14:01:18 +08:00
wwqgtxx cd42e9832c chore: resolver priority return TypeA in ResolveIP (not effected LookupIP) 2023-04-12 22:06:21 +08:00
wwqgtxx 90f95d7c78 chore: wireguard dns can work with domain-based server 2023-04-11 14:10:57 +08:00
Skyxim 7d230139a0 fix: rand ip error and clash remove loopback ip 2023-03-12 18:44:30 +08:00
Skyxim 074fee2b48 chore: add comment 2023-03-12 15:05:28 +08:00
Skyxim 7f588935ea feta: add hosts support domain and mulitple ip (#439)
* feat: host support domain and multiple ips

* chore: append local address via `clash`

* chore: update hosts demo

* chore: unified parse mixed string and array

* fix: flatten cname

* chore: adjust logic

* chore: reuse code

* chore: use cname in tunnel

* chore: try use domain mapping when normal dns

* chore: format code
2023-03-12 15:00:59 +08:00
wwqgtxx 7c34964f87 fix: dns resolver 2023-03-06 19:15:12 +08:00
wwqgtxx 6a97ab9ecb chore: use fastrand to replace math/rand 2023-03-06 18:10:14 +08:00
Dreamacro a6a72a5b54 Feature: add dns query json api 2023-01-28 00:55:24 +08:00
wwqgtxx 7c1b878c3f fix: resolver's ctx 2022-11-19 10:45:44 +08:00
wwqgtxx a3425c0e78 chore: sync dns code 2022-11-12 21:31:07 +08:00
wwqgtxx 901a47318d chore: always pass context when resolve dns 2022-11-12 13:18:36 +08:00
wwqgtxx b699fb046b fix: wireguard's dns resolve 2022-11-09 19:35:03 +08:00
wwqgtxx 22fb219ad8 chore: trie.DomainTrie will not depend on zero value 2022-11-02 22:28:18 +08:00
Skyxim 99effb051b feat: add ip-version param 2022-08-28 13:41:43 +08:00
Skyxim fe3ad3724c fix: resolver error handling exception 2022-07-21 09:02:58 +08:00
Skyxim e1c6142851 fix: pure ip resolve 2022-07-20 22:59:04 +08:00
Skyxim bbac54433e fix: resolve ipv4 of 4 in 6 2022-06-17 21:44:06 +08:00
Skyxim 9e9f459c0e refactor: 优化proxy server nameserver, 当节点专用dns全部查询失败会回落到正常逻辑 2022-06-02 20:58:25 +08:00
Skyxim 9dbe20f2c5 fix: npe when with resolver is nil 2022-04-29 13:03:55 +08:00
Skyxim 81b5543b0d feat: support tcp concurrent, Separate dialing and dns resolver ipv6
tcp-concurrent:true
2022-04-23 00:27:22 +08:00
yaling888 7ca1a03d73 Refactor: metadata use netip.Addr 2022-04-20 22:52:05 +08:00
Kr328 5d36d8b139 Improve: replace bootstrap dns (#2080) 2022-04-19 22:49:39 +08:00
yaling888 0ca10798ea Chore: fix typo 2022-04-19 22:38:20 +08:00
yaling888 3ea3653d7a Chore: persistence fakeip pool state 2022-04-19 22:37:47 +08:00
yaling888 a6eb11ce18 Refactor: DomainTrie use generics 2022-04-12 18:45:47 +08:00