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

v2ray.com/core/app/dns: invalid domain name DNS错误 #2293

Closed
liqimore opened this issue Feb 27, 2020 · 7 comments
Closed

v2ray.com/core/app/dns: invalid domain name DNS错误 #2293

liqimore opened this issue Feb 27, 2020 · 7 comments

Comments

@liqimore
Copy link

提交 Issue 之前请先阅读 Issue 指引,然后回答下面的问题,谢谢。
除非特殊情况,请完整填写所有问题。不按模板发的 issue 将直接被关闭。
如果你遇到的问题不是 V2Ray 的 bug,比如你不清楚要如何配置,请使用Discussion进行讨论。

  1. 你正在使用哪个版本的 V2Ray?(如果服务器和客户端使用了不同版本,请注明)
    4.22.1 服务器与客户端版本一致
  2. 你的使用场景是什么?比如使用 Chrome 通过 Socks/VMess 代理观看 YouTube 视频。
    v2rayN, 网页和YouTube
  3. 你看到的不正常的现象是什么?(请描述具体现象,比如访问超时,TLS 证书错误等)
    域名解析问题, 浏览器包ERR_CONNECTION_CLOSED, 检查日志后发现报错如下
2020/02/28 03:47:43 [Warning] v2ray.com/core/app/router: resolve ip for flick > v2ray.com/core/app/dns: invalid domain name
2020/02/28 03:47:43 [Warning] [1070997716] v2ray.com/core/proxy/freedom: failed to get IP address for domain flick > v2ray.com/core/app/dns: invalid domain name
  1. 你期待看到的正确表现是怎样的?
    域名解析正常
  2. 请附上你的配置(提交 Issue 前请隐藏服务器端IP地址)。

服务器端配置:
服务器的resov.conf设置的DNS是1.1.1.1和1.0.0.1. 服务器域名解析正常

    {
    "outbounds": [
        {
            "protocol": "vmess",
            "settings": {
                "vnext": [
                    {
                        "address": "xxxxxxxxxxxxxx",
                        "port": 443,
                        "users": [
                            {
                                "id": "088203d6-944a-4a0b-a176-f42447123456",
                                "alterId": 123,
                                "security": "auto"
                            }
                        ]
                    }
                ]
            },
            "streamSettings": {
                "network": "ws",
                "security": "tls",
                "tlsSettings": {
                    "serverName": "xxxxxxxxxxxxxxxxxxxxx"
                },
                "wsSettings": {
                    "path": "/xxxxxxxxxxxxxx",
                    "headers": {
                        "Host": "xxxxxxxxxxxxxxxxxxxxx"
                    }
                }
            },
            "mux": {
                "enabled": true
            }
        },
        {
            "protocol": "freedom",
            "settings": {},
            "tag": "direct"
        },
        {
			"protocol": "blackhole",
			"settings": {},
			"tag": "blocked"
        },
        {
            "protocol": "dns",
            "tag": "dns-out"
        }
    ],
    "inbounds": [
        {
            "port": "1099",
            "protocol": "dokodemo-door",
            "settings": {
              "network": "tcp,udp",
              "timeout": 0,
              "followRedirect": true
            },
            "sniffing": {
              "enabled": true,
              "destOverride": ["http", "tls"]
            }
        },
        {
            "port": 2133,
            "tag": "dns-in",
            "protocol": "dokodemo-door",
            "settings": {
                "address": "119.29.29.29",
                "port": 53,
                "timeout": 0,
                "network": "tcp,udp"
            }
        },
        {
            "port": 2333,
            "protocol": "socks",
            "settings": {
                "auth": "noauth",
                "udp": true
            }
        },
        {
            "port": 6666,
            "protocol": "http",
            "settings": {
                "auth": "noauth",
                "udp": true
            }
        }
    ],
    "dns": {
        "servers": [
            {
                "address": "119.29.29.29",
                "port": 53,
                "domains": [
                  "geosite:cn"
                ],
                "expectIPs": [
                  "geoip:cn"
                ]
              },
              {
                "address": "1.1.1.1",
                "port": 53,
                "domains": [
                  "geosite:geolocation-!cn"
                ]
            },
            "8.8.8.8",
            "localhost"
        ]
    },
    "routing": {
        "domainStrategy": "IPOnDemand",	
        "rules": [
            {
                "type": "field",
                "inboundTag": [
                    "dns-in"
                ],
                "outboundTag": "dns-out"
            },
            {
				"type": "field",
				"ip": [
					"geoip:private"
				],
				"outboundTag": "blocked"
			},
            {
                "type": "field",
                "ip": [
                    "geoip:cn"
                ],
                "outboundTag": "direct"
            },
            {
                "type": "field",
                "domain": [
                    "geosite:cn"
                ],
                "outboundTag": "direct"
            }
        ]
    }
}

客户端配置:

    
  1. 请附上出错时软件输出的错误日志。在 Linux 中,日志通常在 /var/log/v2ray/error.log 文件中。

服务器端错误日志:
同上

    // 在这里附上服务器端日志

客户端错误日志:
同上

    // 在这里附上客户端日志
  1. 请附上访问日志。在 Linux 中,日志通常在 /var/log/v2ray/access.log 文件中。
    同上
    // 在这里附上服务器端日志
  1. 其它相关的配置文件(如 Nginx)和相关日志。

  2. 如果 V2Ray 无法启动,请附上 --test 输出。

通常的命令为 /usr/bin/v2ray/v2ray --test --config /etc/v2ray/config.json。请按实际情况修改。

  1. 如果 V2Ray 服务运行不正常,请附上 journal 日志。

通常的命令为 journalctl -u v2ray

请预览一下你填的内容再提交。

@kslr kslr added the Need Logs label Feb 28, 2020
@KirbyKFC
Copy link

说明一个情况:
系统设置http代理,通过chrome地址栏使用搜索功能的时候,chrome会发送http://<punycode编码的搜索内容>/的连接请求到代理,<punycode编码的搜索内容>显然是个不合法的域名,会产生invalid domain name警告。

你需要确认你描述的invalid domain name警告是否是因此产生的。
另外我描述的这个场景是不影响正常使用的。

附该情况下的客户端log:

2020/02/28 14:54:55 [Info] [2055967417] v2ray.com/core/proxy/http: request to Method [HEAD] Host [xn--4gqvd515fcqg4j5bdbf] with URL [http://xn--4gqvd515fcqg4j5bdbf/]
2020/02/28 14:54:55 [Warning] v2ray.com/core/app/router: resolve ip for xn--4gqvd515fcqg4j5bdbf > v2ray.com/core/app/dns: invalid domain name
2020/02/28 14:54:55 [Warning] v2ray.com/core/app/router: resolve ip for xn--4gqvd515fcqg4j5bdbf > v2ray.com/core/app/dns: invalid domain name
2020/02/28 14:54:55 [Info] [2055967417] v2ray.com/core/app/dispatcher: default route for tcp:xn--4gqvd515fcqg4j5bdbf:80
2020/02/28 14:54:55 [Info] [2055967417] v2ray.com/core/transport/internet/websocket: creating connection to tcp:xxx.xxx.com:443
2020/02/28 14:54:59 [Info] [2055967417] v2ray.com/core/proxy/vmess/outbound: tunneling request to tcp:xn--4gqvd515fcqg4j5bdbf:80 via tcp:xxx.xxx.com:443
2020/02/28 14:55:01 [Info] [2055967417] v2ray.com/core/app/proxyman/outbound: failed to process outbound traffic > v2ray.com/core/proxy/vmess/outbound: connection ends > websocket: close 1000 (normal)
2020/02/28 14:55:01 [Warning] [2055967417] v2ray.com/core/proxy/http: failed to read response from xn--4gqvd515fcqg4j5bdbf > io: read/write on closed pipe
2020/02/28 14:55:01 [Info] [2055967417] v2ray.com/core/app/proxyman/inbound: connection ends > v2ray.com/core/proxy/http: failed to read http request > EOF

@liqimore
Copy link
Author

liqimore commented Mar 1, 2020

说明一个情况:
系统设置http代理,通过chrome地址栏使用搜索功能的时候,chrome会发送http://<punycode编码的搜索内容>/的连接请求到代理,<punycode编码的搜索内容>显然是个不合法的域名,会产生invalid domain name警告。

你需要确认你描述的invalid domain name警告是否是因此产生的。
另外我描述的这个场景是不影响正常使用的。

附该情况下的客户端log:

2020/02/28 14:54:55 [Info] [2055967417] v2ray.com/core/proxy/http: request to Method [HEAD] Host [xn--4gqvd515fcqg4j5bdbf] with URL [http://xn--4gqvd515fcqg4j5bdbf/]
2020/02/28 14:54:55 [Warning] v2ray.com/core/app/router: resolve ip for xn--4gqvd515fcqg4j5bdbf > v2ray.com/core/app/dns: invalid domain name
2020/02/28 14:54:55 [Warning] v2ray.com/core/app/router: resolve ip for xn--4gqvd515fcqg4j5bdbf > v2ray.com/core/app/dns: invalid domain name
2020/02/28 14:54:55 [Info] [2055967417] v2ray.com/core/app/dispatcher: default route for tcp:xn--4gqvd515fcqg4j5bdbf:80
2020/02/28 14:54:55 [Info] [2055967417] v2ray.com/core/transport/internet/websocket: creating connection to tcp:xxx.xxx.com:443
2020/02/28 14:54:59 [Info] [2055967417] v2ray.com/core/proxy/vmess/outbound: tunneling request to tcp:xn--4gqvd515fcqg4j5bdbf:80 via tcp:xxx.xxx.com:443
2020/02/28 14:55:01 [Info] [2055967417] v2ray.com/core/app/proxyman/outbound: failed to process outbound traffic > v2ray.com/core/proxy/vmess/outbound: connection ends > websocket: close 1000 (normal)
2020/02/28 14:55:01 [Warning] [2055967417] v2ray.com/core/proxy/http: failed to read response from xn--4gqvd515fcqg4j5bdbf > io: read/write on closed pipe
2020/02/28 14:55:01 [Info] [2055967417] v2ray.com/core/app/proxyman/inbound: connection ends > v2ray.com/core/proxy/http: failed to read http request > EOF

有一大部分都是这个原因, 请看日志. 有什么办法解决吗?

2020/03/02 02:23:11 [Warning] v2ray.com/core/app/router: resolve ip for ejfoyvjhhds > v2ray.com/core/app/dns: invalid domain name
2020/03/02 02:23:11 [Warning] v2ray.com/core/app/router: resolve ip for sfayyijdzvwkr > v2ray.com/core/app/dns: invalid domain name
2020/03/02 02:23:11 [Warning] v2ray.com/core/app/router: resolve ip for ejfoyvjhhds > v2ray.com/core/app/dns: invalid domain name
2020/03/02 02:23:11 [Warning] v2ray.com/core/app/router: resolve ip for sfayyijdzvwkr > v2ray.com/core/app/dns: invalid domain name
2020/03/02 02:23:11 [Warning] v2ray.com/core/app/router: resolve ip for spdzzoymzlzncwo > v2ray.com/core/app/dns: invalid domain name
2020/03/02 02:23:11 [Warning] v2ray.com/core/app/router: resolve ip for spdzzoymzlzncwo > v2ray.com/core/app/dns: invalid domain name
2020/03/02 02:23:11 [Warning] v2ray.com/core/app/router: resolve ip for spdzzoymzlzncwo > v2ray.com/core/app/dns: invalid domain name

@KirbyKFC
Copy link

KirbyKFC commented Mar 3, 2020

这种情况不需要解决。你应该使用其他工具(nslookup等)检查域名解析问题,并贴出其他部分的日志,因为问题不一定出在域名解析上。

@y11022053
Copy link

插个眼,我遇到的问题也是如此,日志出现一些莫名其妙字符串的域名,然后就报错invalid domain name,也同样是在chrome的地址栏进行直接关键字搜索,请问如何避免呢?

@fbion
Copy link

fbion commented Mar 12, 2020

chrome
mark

@bilibilistack
Copy link

bilibilistack commented May 12, 2020

同样的问题,有这样的log
在chrome地址里面直接搜索时候,有概率会出现这样的问题。出现后大概过1分钟才能恢复网络
WS+TLS
服务端log:
v2ray.com/core/proxy/freedom: failed to get IP address for domain zhong > v2ray.com/core/app/dns: invalid domain name
服务端dns设置的是8.8.4.4
客户端全局,log:
2020/05/12 16:25:43 [Info] [3549661102] v2ray.com/core/common/mux: dispatching request to tcp:www.google.com:443
2020/05/12 16:25:44 [Info] [3549661102] v2ray.com/core/common/mux: failed to fetch all input > io: read/write on closed pipe
2020/05/12 16:25:44 [Info] [3549661102] v2ray.com/core/app/proxyman/inbound: connection ends > v2ray.com/core/proxy/socks: connection ends > v2ray.com/core/proxy/socks: failed to transport all TCP response > io: read/write on closed pipe

@nicholascw
Copy link
Contributor

Invalid domain name will be reported when the domain name is indeed invalid, and they are [info], which doesn't at all means an error.

@azazjjyjjy yours seems to be a separate issue and related to mux. try turn it off as a workaround and use a separate issue.

Articles related:
https://bugs.chromium.org/p/chromium/issues/detail?id=935772
https://sites.google.com/a/chromium.org/dev/developers/design-documents/dns-prefetching
https://support.mozilla.org/en-US/kb/firefox-cant-load-websites-other-browsers-can#w_dns-prefetching
https://en.wikipedia.org/wiki/Web_Proxy_Auto-Discovery_Protocol

Issue related:
#2504

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

No branches or pull requests

7 participants