x-ui 配置dns服务器

关于

x-ui:https://github.com/vaxilu/x-ui

模板

{
"dns": {
    "hosts": {
      "geosite:netflix": "5.5.5.5",
      "geosite:disney": "5.5.5.5"
    },
     "servers": [
      "8.8.8.8",
      "1.1.1.1"
    ]
  },
  "api": {
    "services": [
      "HandlerService",
      "LoggerService",
      "StatsService"
    ],
    "tag": "api"
  },
  "inbounds": [
    {
      "listen": "127.0.0.1",
      "port": 62789,
      "protocol": "dokodemo-door",
      "settings": {
        "address": "127.0.0.1"
      },
      "tag": "api"
    }
  ],
  "outbounds": [
    {
      "protocol": "freedom",
      "settings": {"domainStrategy": "UseIP"}
    },
    {
      "protocol": "blackhole",
      "settings": {},
      "tag": "blocked"
    }
  ],
  "policy": {
    "system": {
      "statsInboundDownlink": true,
      "statsInboundUplink": true
    }
  },
  "routing": {
    "rules": [
      {
        "inboundTag": [
          "api"
        ],
        "outboundTag": "api",
        "type": "field"
      },
      {
        "ip": [
          "geoip:private"
        ],
        "outboundTag": "blocked",
        "type": "field"
      },
      {
        "outboundTag": "blocked",
        "protocol": [
          "bittorrent"
        ],
        "type": "field"
      }
    ]
  },
  "stats": {}
}

其中,在 host 项里,默认配置了 Netflix 和 Disney,5.5.5.5 代表要配置的 dns 服务器。替换为已解锁的 dns 服务器的 IP 后,即可实现解锁,也可以手动配置其他解锁,如:"geosite:youtube": "5.5.5.5" ,每个解锁服务器之间尾部要跟上一个英文逗号

其他

由于这个项目已经很长时间没有更新,所以项目中的路由 IP 规则库并不能支持一些新的站点,如:geosite:openai

需要手动更新下才能用新的路由规则,更新 x-ui 的 bin 目录下 geoip.dat 和 geosite.dat 即可实现更新

声 明 1 bujj博客:www.bujj.org
2 原创文章,转载请注明转自bujj博客:www.bujj.org
3 当前页网址:https://www.bujj.org/index.php/2023/09/18/558/
THE END
分享
二维码
< <上一篇
下一篇>>