You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
目前的“过滤代理域名 IPv6”,在使用 Dnsmasq 分流时,实际是把对应域名绑定到“::”这个地址,这会导致一些程序错误去请求“::”。
例如 OpenWRT 自带的 uclient-fetch(精简版wget)就不会忽略“::”,执行
uclient-fetch -O- https://gstatic.com/
时,真的会去请求“::”,产生错误:为了避免此类问题,我们需要一个纯 IPv4 的 DNS 服务。事实上,Dnsmasq 本就支持过滤掉 AAAA记录,也就是“filter-AAAA”参数。但是为了避免影响默认的 DNS 服务,我们应该另外创建一个 DNS 服务,监听不同的地址。
创建文件
/etc/dnsmasq-pure4.conf
,内容如下:使用
/usr/sbin/dnsmasq -C /etc/dnsmasq-pure4.conf -k
命令启动(如果要测试,可以使用/usr/sbin/dnsmasq -C /etc/dnsmasq-pure4.conf -d
)。启动以后,passwall中取消勾选“过滤代理域名 IPv6”,并将“远程DNS”修改成“127.0.0.53”就能实现代理域名只解析IPv4了(“过滤模式”必须是“通过 UDP 请求 DNS”)。
修改前:
修改后:
修改后 uclient-fetch 也不会再错误请求“::”了。
注意上面创建的 DNS 服务只是临时的,适用于开发过程中测试。如果要持久化这个服务,可以参考 istoreos/istoreos#1875
Beta Was this translation helpful? Give feedback.
All reactions