我在家里的内网部署了 dns (开源项目 bloky),在内网使用是正常的。
我在公司上班笔记本都是开着三个 vpn 软件:工作的 vpn ,wireguard (访问家里),clash-verge (用的 meta 核心)。
因为工作时要连接公司的 vpn ,所以在 clash-verge 配置文件里 .dns.nameserver-policy 我指定了工作使用的域名走工作的 dns ,工作上我使用起来是正常的。
dns: enable: true ipv6: false enhanced-mode: redir-host fake-ip-range: 198.18.0.1/16 proxy-server-nameserver: - 8.8.8.8 default-nameserver: - 8.8.8.8 nameserver: - 8.8.8.8 - 10.30.1.29 #工作 dns - 192.168.20.74 #家里 dns nameserver-policy: '+.xxx.com.cn': '10.30.1.29' #工作域名 '+.xxx.com': '192.168.20.74' #家里域名 tun: enable: true stack: system dns-hijack: - any:53 auto-route: true auto-detect-interface: true inet4_route_address:
我使用 wireguard 连接内网,同样在配置文件里 .dns.nameserver-policy 设置内网域名走家里内网 dns ,但是没有效果。
在 powershell 中使用 nslookup 指定家里域名和家里 dns 提示:DNS request timed out.
我在部署家里内网 dns 前一直都是使用 wireguard 直连的,ip 都能正常访问。
( clash-verge 一直都是使用 tun 模式)
我关闭了工作 vpn 和 clash-verge ,并配置 wireguard dns 为内网 dns
[Interface] PrivateKey = Address = 10.66.99.21/32 DNS = 192.168.20.74 [Peer] PublicKey = PresharedKey = AllowedIPs = 192.168.20.0/24, 192.168.3.0/24, 192.168.100.0/24, 10.66.99.0/24 Endpoint =
此时使用 nslookup 指定家里域名和家里 dns 还是提示:DNS request timed out.
1 joenlee 2024-10-17 14:59:47 +08:00 请问解决了吗?我也遇到这个问题了 |
2 jqbbbbb123 OP @joenlee 我解决了,我当时家里的 wireguard 部署在 openwrt 上,openwrt 我打开了 dns 劫持,我关闭了。然后本地 clash 中添加如下配置就可以了。 ```yaml dns: enable: true respect-rules: true proxies: - {name: wg, type: wireguard, server: , port: , ip: , public-key: , private-key: ,remote-dns-resolve: true, dns: [], udp: true } ``` |