Closed JMVoid closed 5 years ago
现在v2ray config 完全取消dns的项的配置。发现v2ray默认能自动进行dns解析并区别境外和国内流量 例如我连接studygolang.com . 看日志如下 2018/11/15 17:59:45 [Info] [2783498905] v2ray.com/core/proxy/socks: TCP Connect request to tcp:www.studygolang.com:80 2018/11/15 17:59:45 [Info] [692479038] v2ray.com/core/proxy/socks: TCP Connect request to tcp:studygolang.com:443 2018/11/15 17:59:45 [Info] [692479038] v2ray.com/core/app/dispatcher: sniffed domain: studygolang.com 2018/11/15 17:59:45 [Info] v2ray.com/core/app/router: looking for IP for domain: studygolang.com 2018/11/15 17:59:45 [Info] [692479038] v2ray.com/core/app/dispatcher: taking detour [direct] for [tcp:studygolang.com:443] 2018/11/15 17:59:45 [Info] [692479038] v2ray.com/core/proxy/freedom: opening connection to tcp:studygolang.com:443 2018/11/15 17:59:45 [Info] [692479038] v2ray.com/core/transport/internet/tcp: dialing TCP to tcp:studygolang.com:443 能用direct进行国内的连接 而google 则会走代理 2018/11/15 17:59:41 [Info] v2ray.com/core/app/router: looking for IP for domain: www.google.com 2018/11/15 17:59:41 [Info] [3949900231] v2ray.com/core/app/dispatcher: default route for tcp:www.google.com:443 2018/11/15 17:59:41 [Info] [3949900231] v2ray.com/core/common/mux: dispatching request to tcp:www.google.com:443
我使用的config 文件内容如下: { "log": { "access": "e:\dnstest-access.log", "error": "e:\dnstest-error.log", "loglevel": "debug" },
"inbound": { "port": 1088, "listen": "127.0.0.1", "protocol": "socks", "sniffing": { "enabled": true, "destOverride": [ "http", "tls" ] }, "settings": { "auth": "noauth", "udp": true, "ip": "127.0.0.1", "clients": null }, "streamSettings": null },
"outbound": { "tag": "agentout", "protocol": "vmess", "settings": { "vnext": [ { "address": "n01a.a.hk.bitstunnel.xyz", "port": 30001, "users": [ { "id": "5c72b456-a2ac-4cbf-a532-f5cffc2b242f", "alterId": 12, "email": "t@t.tt", "security": "aes-128-gcm" } ] } ], "servers": null }, "streamSettings": { "network": "kcp", "security": "", "tlsSettings": null, "tcpSettings": null, "kcpSettings": { "mtu": 1350, "tti": 50, "uplinkCapacity": 12, "downlinkCapacity": 100, "congestion": false, "readBufferSize": 2, "writeBufferSize": 2, "header": { "type": "utp", "request": null, "response": null } }, "wsSettings": null, "httpSettings": null }, "mux": { "enabled": true } }, "outboundDetour": [ { "protocol": "freedom", "settings": { "response": null }, "tag": "direct" }, { "protocol": "blackhole", "settings": { "response": { "type": "http" } }, "tag": "blockout" } ], "routing": { "strategy": "rules", "settings": { "domainStrategy": "IPIfNonMatch", "rules": [ { "type": "field", "port": null, "outboundTag": "direct", "ip": null, "domain": [ "geosite:cn" ] }, { "type": "field", "port": null, "outboundTag": "direct", "ip": [ "geoip:cn" ], "domain": null }, { "type": "field", "port": null, "outboundTag": "direct", "ip": [ "0.0.0.0/8", "10.0.0.0/8", "100.64.0.0/10", "127.0.0.0/8", "169.254.0.0/16", "172.16.0.0/12", "192.0.0.0/24", "192.0.2.0/24", "192.168.0.0/16", "198.18.0.0/15", "198.51.100.0/24", "203.0.113.0/24", "::1/128", "fc00::/7", "fe80::/10" ], "domain": null } ] } } }
在此求关于v2ray的dns的默认解析的机制是怎么样的? 多谢了
用的是本机的DNS,和浏览器之类的工具不用代理的时候解析方式一样
@VictoriaRaymond 感谢回复了。我困惑是境外的域名默认是如何解析的? 对于境外的域名是本地的v2ray 将域名丢到远端的v2ray进行解析吗?本地的v2ray又如何知道该域名是否应该丢给远端的v2ray进行解析?
1, 2. 本地dns
现在v2ray config 完全取消dns的项的配置。发现v2ray默认能自动进行dns解析并区别境外和国内流量 例如我连接studygolang.com . 看日志如下 2018/11/15 17:59:45 [Info] [2783498905] v2ray.com/core/proxy/socks: TCP Connect request to tcp:www.studygolang.com:80 2018/11/15 17:59:45 [Info] [692479038] v2ray.com/core/proxy/socks: TCP Connect request to tcp:studygolang.com:443 2018/11/15 17:59:45 [Info] [692479038] v2ray.com/core/app/dispatcher: sniffed domain: studygolang.com 2018/11/15 17:59:45 [Info] v2ray.com/core/app/router: looking for IP for domain: studygolang.com 2018/11/15 17:59:45 [Info] [692479038] v2ray.com/core/app/dispatcher: taking detour [direct] for [tcp:studygolang.com:443] 2018/11/15 17:59:45 [Info] [692479038] v2ray.com/core/proxy/freedom: opening connection to tcp:studygolang.com:443 2018/11/15 17:59:45 [Info] [692479038] v2ray.com/core/transport/internet/tcp: dialing TCP to tcp:studygolang.com:443 能用direct进行国内的连接 而google 则会走代理 2018/11/15 17:59:41 [Info] v2ray.com/core/app/router: looking for IP for domain: www.google.com 2018/11/15 17:59:41 [Info] [3949900231] v2ray.com/core/app/dispatcher: default route for tcp:www.google.com:443 2018/11/15 17:59:41 [Info] [3949900231] v2ray.com/core/common/mux: dispatching request to tcp:www.google.com:443
我使用的config 文件内容如下: { "log": { "access": "e:\dnstest-access.log", "error": "e:\dnstest-error.log", "loglevel": "debug" },
"inbound": { "port": 1088, "listen": "127.0.0.1", "protocol": "socks", "sniffing": { "enabled": true, "destOverride": [ "http", "tls" ] }, "settings": { "auth": "noauth", "udp": true, "ip": "127.0.0.1", "clients": null }, "streamSettings": null },
"outbound": { "tag": "agentout", "protocol": "vmess", "settings": { "vnext": [ { "address": "n01a.a.hk.bitstunnel.xyz", "port": 30001, "users": [ { "id": "5c72b456-a2ac-4cbf-a532-f5cffc2b242f", "alterId": 12, "email": "t@t.tt", "security": "aes-128-gcm" } ] } ], "servers": null }, "streamSettings": { "network": "kcp", "security": "", "tlsSettings": null, "tcpSettings": null, "kcpSettings": { "mtu": 1350, "tti": 50, "uplinkCapacity": 12, "downlinkCapacity": 100, "congestion": false, "readBufferSize": 2, "writeBufferSize": 2, "header": { "type": "utp", "request": null, "response": null } }, "wsSettings": null, "httpSettings": null }, "mux": { "enabled": true } }, "outboundDetour": [ { "protocol": "freedom", "settings": { "response": null }, "tag": "direct" }, { "protocol": "blackhole", "settings": { "response": { "type": "http" } }, "tag": "blockout" } ], "routing": { "strategy": "rules", "settings": { "domainStrategy": "IPIfNonMatch", "rules": [ { "type": "field", "port": null, "outboundTag": "direct", "ip": null, "domain": [ "geosite:cn" ] }, { "type": "field", "port": null, "outboundTag": "direct", "ip": [ "geoip:cn" ], "domain": null }, { "type": "field", "port": null, "outboundTag": "direct", "ip": [ "0.0.0.0/8", "10.0.0.0/8", "100.64.0.0/10", "127.0.0.0/8", "169.254.0.0/16", "172.16.0.0/12", "192.0.0.0/24", "192.0.2.0/24", "192.168.0.0/16", "198.18.0.0/15", "198.51.100.0/24", "203.0.113.0/24", "::1/128", "fc00::/7", "fe80::/10" ], "domain": null } ] } } }
在此求关于v2ray的dns的默认解析的机制是怎么样的? 多谢了