Closed flukaxkx closed 5 years ago
另一个域名的dns查询记录,我删掉了有关其他域名的log。开始的时候很慢。
May 31 23:10:14 dnsmasq[5883]: query[A] www.vpsrb.com from 192.168.1.144
May 31 23:10:14 dnsmasq[5883]: forwarded www.vpsrb.com to 127.0.0.1
May 31 23:10:15 dnsmasq[5883]: query[A] www.vpsrb.com from 192.168.1.144
May 31 23:10:15 dnsmasq[5883]: forwarded www.vpsrb.com to 127.0.0.1
May 31 23:10:16 dnsmasq[5883]: query[A] www.vpsrb.com from 192.168.1.144
May 31 23:10:16 dnsmasq[5883]: forwarded www.vpsrb.com to 127.0.0.1
May 31 23:13:23 dnsmasq[5883]: query[A] www.vpsrb.com from 192.168.1.144
May 31 23:13:23 dnsmasq[5883]: forwarded www.vpsrb.com to 127.0.0.1
May 31 23:13:30 dnsmasq[5883]: query[A] www.vpsrb.com from 192.168.1.144
May 31 23:13:30 dnsmasq[5883]: forwarded www.vpsrb.com to 127.0.0.1
May 31 23:13:31 dnsmasq[5883]: query[A] www.vpsrb.com from 192.168.1.144
May 31 23:13:31 dnsmasq[5883]: forwarded www.vpsrb.com to 127.0.0.1
May 31 23:13:32 dnsmasq[5883]: query[A] www.vpsrb.com from 192.168.1.144
May 31 23:13:32 dnsmasq[5883]: forwarded www.vpsrb.com to 127.0.0.1
May 31 23:13:34 dnsmasq[5883]: query[A] www.vpsrb.com from 192.168.1.144
May 31 23:13:34 dnsmasq[5883]: forwarded www.vpsrb.com to 127.0.0.1
May 31 23:13:36 dnsmasq[5883]: query[A] www.vpsrb.com from 192.168.1.144
May 31 23:13:36 dnsmasq[5883]: forwarded www.vpsrb.com to 127.0.0.1
May 31 23:13:37 dnsmasq[5883]: query[A] www.vpsrb.com from 192.168.1.144
May 31 23:13:37 dnsmasq[5883]: forwarded www.vpsrb.com to 127.0.0.1
May 31 23:13:38 dnsmasq[5883]: query[A] www.vpsrb.com from 192.168.1.144
May 31 23:13:38 dnsmasq[5883]: forwarded www.vpsrb.com to 127.0.0.1
May 31 23:13:38 dnsmasq[5883]: reply www.vpsrb.com is 116.196.67.254
May 31 23:13:43 dnsmasq[5883]: query[A] vpsrb.com from 192.168.1.144
May 31 23:13:43 dnsmasq[5883]: forwarded vpsrb.com to 127.0.0.1
May 31 23:13:44 dnsmasq[5883]: query[A] vpsrb.com from 192.168.1.144
May 31 23:13:44 dnsmasq[5883]: forwarded vpsrb.com to 127.0.0.1
May 31 23:13:44 dnsmasq[5883]: reply vpsrb.com is 116.196.67.254
你和我开始搞的配置简直一模一样,不过我不在路由上,而是局域网上的一个虚拟机做软路由。DNS解析的问题困扰了我很久,经常在DNS解析这里V2ray就死火了,这样什么网站都看不了,在dnsmasq fowarded的时候看看v2ray的error.log是否有断开的提示,我的v2ray服务端是websocket+tls+web方式,理论上应该不会被墙盯上,可是还是有大量failed to dial websocket的错误提示,后来我感觉这个错误提示对网页浏览没影响,因为很快就重连上了,可是dns查询的时候一旦出现这个错误,浏览器就会收到dns timeout错误,于是彻底翻不了墙。
于是我改成不用v2ray来转发dns查询了,改成用dns-over-https的方式来,项目网站在 http://dns-over-https.com/ 。远端dns服务器使用Cloudflare的服务:https://cloudflare-dns.com/dns-query ,直连不走V2ray通道,分流依然用dnsmasq,目前这个方案运行了两天,没有再出现dns timeout的错误。
这个好啊,可以通过tcp来解析dns了。
我现在换了一种类似的思路了,可以直接在linux盒子上做透明网关,实现路由、分流、upnp等各种功能了。 还是黑名单模式,基本思路是:
这样做的好处:
这样做的缺点和注意事项:
真是够复杂的…太厉害了,折腾好了之后的空虚感,hmm…握手!
1) 你正在使用哪个版本的 V2Ray? 3.23
2) 你的使用场景是什么? 在路由器上做透明代理,目前只用iptables代理了tcp,udp部分还没弄明白。 同时用dnsmasq配合做dns查询与缓存。 采用黑名单模式,只有黑名单中的网站用 8.8.8.8解析,并走代理, 默认是 freedom模式,用114.114.114.114解析,并直接访问。
3) 你看到的不正常的现象是什么? iplocation.net在黑名单中,长时间不访问后的第一次访问,显示的是本机的真实ip, 此后刷新才会显示vps的ip。 类似的,一些黑名单中的网站,第一次访问都会出现解析不到dns的问题, 等一下再刷新就好了。
4) 你期待看到的正确表现是怎样的? 我想请教的问题是: 1,上述问题出在何处,如何能够更正。 2,在iptables不设置udp转发的情况下,按照我的客户端配置,把gfwlist中的网站直接用8.8.8.8解析和用127.0.0.1#5353解析有什么区别(如下述的两行设置),
会不会有一种配置导致解析过程没有通过v2ray而导致结果被污染。
5) 请附上你的配置(提交 Issue 前请隐藏服务器端IP地址)。 客户端配置:
6) 请附上出错时软件输出的错误日志。
8) 其它相关的配置文件(如 Nginx)和相关日志。 dnsmasq.conf
/etc/dnsmasq.d/gfwlist.conf