202 words
1 minute
Xray-DNS配置
2026-02-27
No Tags

背景#

某一些主机服务商给的默认配置不是很理想,或者本身落地解锁就不太行的,比如Racknerd,Cloudcone之类主打廉价小机的服务商

正确配置是为了更好的上网体验

配置#

xray的配置结构,直接加入DNS一段

{
"log": {
"loglevel": "none" // 日志
},
"dns": {
"servers": [
"1.1.1.1"
]
},
"inbounds": [{}], //入站协议
"outbounds": [
{
"protocol": "freedom",
"tag": "direct", //出站协议
}
]
}

1.1.1.1就是当前指定DNS了,数组内建议配置1-2个解析服务器

出站策略,freedom出站发出流量默认使用系统解析

调整出站策略为使用xray解析(感谢 @宋哈娜 指导)

{
"tag": "direct",
"protocol": "freedom",
"settings": {
"domainStrategy": "useIP"
}
}

拜托~去改/etc/resolve.conf然后问为什么配置会被重置,弱爆了

Xray-DNS配置
https://fuwari.vercel.app/posts/xray/dns/
Author
Christine
Published at
2026-02-27
License
CC BY-NC-SA 4.0