v2rayN icon indicating copy to clipboard operation
v2rayN copied to clipboard

[Bug]: DNS queries still resolved by v2rayn when using localhost in dns settings | 在 dns 设置中使用 localhost 时,v2rayn 仍会解析 DNS 查询

Open msshn opened this issue 2 years ago • 2 comments

预期情况

DNS queries get resolved by system | DNS 查询由系统解析

实际情况

when setting dns to localhost in dns settings, dns queries should bypass proxy and get resolved directly by system

在 dns 设置中将 dns 设置为 localhost 时,dns 查询应绕过代理并由系统直接解析

复现方法

set system proxy set localhost in dns settings visit ipleak.net or dnsleaktest.net, you can see dns queries still going to proxy server

设置系统代理 在 dns 设置中设置 localhost 访问 ipleak.net 或 dnsleaktest.net,你可以看到 dns 查询仍然去代理服务器

日志信息

2022-12-12 - Copy.txt

额外信息

I'm running dnscrypt-proxy with my custom dns server to handle all dns queries. when directly connected without proxy there is no issue and dnsleaktest and ipleak only show my dns server. Also my dns server has adblocking and in this mode it's working perfectly. when connected to proxy, all or some of dns queries go through proxy no matter what i do. I have tested seting dns server in v2rayn to localhost or 127.0.0.1 with "domain strategy" set to "use ip" but nothing happened. i have used both http proxy and socks proxy in firefox. when using socks if i check "Proxy DNS when using SOCKS 5" all dns queries go through proxy. when not checking this option or using http proxy, dns queries go through both proxy server dns and my custom dns server. Also adblocking of my dns server do not work. dnscrypt is listening on 127.0.0.1:53 and system dns also set to 127.0.0.1.

tl;dr : basically i wnat to bypass v2rayn handling dns queries.

我正在使用我的自定义 dns 服务器运行 dnscrypt-proxy 来处理所有 dns 查询。 在没有代理的情况下直接连接时没有问题,dnsleaktest 和 ipleak 只显示我的 dns 服务器。 我的 dns 服务器也有广告拦截,在这种模式下它工作得很好。 当连接到代理时,无论我做什么,所有或部分 DNS 查询都会通过代理。 我测试过将 v2rayn 中的 dns 服务器设置为本地主机或 127.0.0.1,并将“域策略”设置为“使用 ip”,但没有任何反应。 我在 firefox 中同时使用了 http 代理和 socks 代理。 使用袜子时,如果我选中“使用 SOCKS 5 时代理 DNS”,则所有 dns 查询都会通过代理。 当不选中此选项或使用 http 代理时,dns 查询会同时通过代理服务器 dns 和我的自定义 dns 服务器。 我的 DNS 服务器的广告拦截也不起作用。 dnscrypt 正在侦听 127.0.0.1:53,系统 dns 也设置为 127.0.0.1。

tl;dr:基本上我想绕过 v2rayn 处理 dns 查询.

我确认已更新至最新版本

  • [X] 是

我确认已查询历史issues

  • [X] 是

msshn avatar Dec 12 '22 09:12 msshn

The new ver 6.0/6.1 add "RouteOnly“,you can open this. but u need change core-dns setting-outbound "asis"and rule "asis". see this:https://xtls.github.io/Xray-docs-next/config/inbound.html#sniffingobject and windows socks is not good because dosn't support IPV6.

Extreme-Icer avatar Jan 02 '23 05:01 Extreme-Icer

It didn't work or maybe i'm doing it wrong. core-dns set to https://example.com/dns-query core-dns setting-outbound is set to asis routing rule for direct connect added in routingsettings with domain on the left column and ip in the right column. routing domain strategy: asis

what i want to happen : DNS query --> DNS Server what actually happen : DNS query --> v2ray --> Proxy server --> DNS server

msshn avatar Jan 02 '23 16:01 msshn