Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

custom DNS settings in custom config do not work at all when "local dns" is enabled #3670

Open
mmmray opened this issue Oct 8, 2024 · 4 comments

Comments

@mmmray
Copy link

mmmray commented Oct 8, 2024

在提出问题前请先自行排除服务器端问题,同时也请通过搜索确认是否有人提出过相同问题。

预期行为 (expected behavior)

DNS settings can be customized using JSON subs, just like with regular core.

实际行为 (actual behavior)

When using a JSON subscription or custom JSON config with dns section, and enabling the "enable local dns" option, v2rayNG fails all DNS queries by timeout/hang.

复现方法 (reproduction method)

contents of json subscription:

[
  {
    "inbounds": [
      {
        "listen": "127.0.0.1",
        "port": 2080,
        "protocol": "socks",
        "settings": {
          "udp": true
        }
      }
    ],
    "routing": {},
    "log": {
      "loglevel": "warning"
    },
    "dns": {
      "servers": [
        "1.1.1.1"
      ],
      "queryStrategy": "UseIPv4",
      "tag": "dns-in"
    },
    "outbounds": [
      // redacted
    ],
    "remarks": "test"
  }
]
  1. host above as a file somewhere for subs, add an outbound, add it to v2rayNG
  2. "enable local DNS" in settings (keep everything else as-is)
  3. observe dig google.com hanging in termux, similar behavior from chrome (tried with/without chrome's DoH)
  4. disabling "enable local DNS" fixes it again

日志信息

There are no relevant logs. The core starts successfully and then no logs are printed. The log output is identical to when it works (step 4) vs when it doesn't work (step 3).

通过adb logcat -s com.v2ray.ang GoLog V2rayConfigUtilGoLog Main获取日志。请自行删减日志中可能出现的敏感信息。

如果问题可重现,建议先执行adb logcat -c清空系统日志再执行上述命令,再操作重现问题。

10-08 10:19:11.284  4525  4525 I GoLog   : start core
10-08 10:19:11.290  4525  4547 I GoLog   : [Warning] core: Xray 24.9.30 started
10-08 10:19:11.335  4525  4525 D com.v2ray.ang: [/data/app/com.v2ray.ang-DfSxD05GmpgnNrmw36O_Kw==/lib/arm64/libtun2socks.so, --netif-ipaddr, 26.26.26.2, --netif-netmask, 255.255.255.252, --socks-server-addr, 127.0.0.1:10808, --tunmtu, 1500, --sock-path, sock_path, --enable-udprelay, --loglevel, notice, --dnsgw, 127.0.0.1:10853]
10-08 10:19:11.340  4525  4525 D com.v2ray.ang: Process[pid=7083, hasExited=false]
10-08 10:19:11.340  4525  4525 D com.v2ray.ang: /data/user/0/com.v2ray.ang/files/sock_path
10-08 10:19:11.341  4525  7084 D com.v2ray.ang: libtun2socks.so check
10-08 10:19:11.355  4525  4525 D com.v2ray.ang: runPlugin
10-08 10:19:11.391  4525  4573 D com.v2ray.ang: sendFd tries: 0
10-08 10:19:13.950  4525  4555 I GoLog   : Using Prepared: 188.114.96.10

环境信息

v2rayng 1.9.6, tested with two completely different servers and protocols, one of them has no server side routing

额外信息(可选)

changing the dns server in the json config makes no difference

the same config works ok when launched with core directly (checking with curl -x socks5h://..)

@realartin
Copy link

it's true

@realartin
Copy link

also we need that dns query will be resolve trough proxy tunnel it self !

@2dust
Copy link
Owner

2dust commented Oct 9, 2024

private fun customLocalDns(v2rayConfig: V2rayConfig): Boolean {

Check the code here, there are some changes to the configuration file when this is enabled.

Using the in-app function Export full configuration to clipboard you can see the full configuration

@mmmray
Copy link
Author

mmmray commented Oct 11, 2024

i'm not able to see these changes when using Export full configuration. Are you saying this is expected behavior or should I look into this code to fix the bug?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants