Menu

Plan3

防DNS劫持

方案三:

CLI 方式

  • 配置 dnsmasq 上游服务器

    使用以下命令
    uci set dhcp.@dnsmasq[-1].noresolv='1'
    uci set dhcp.@dnsmasq[-1].local='127.0.0.1#5353'
    uci delete dhcp.@dnsmasq[-1].server
    uci commit dhcp

  • 使用 /etc/init.d/chinadns start 命令启动 ChinaDNS

  • 使用 /etc/init.d/dnsmasq restart 命令重启 dnsmasq

LuCI 方式

  • 定位至「网络 - DHCP/DNS」

    「基本设置」 本地服务器 填写 127.0.0.1#5353
    「HOSTS和解析文件」勾选 忽略解析文件

拓展方案

在作为翻墙使用的服务端同时安装 dnsmasq 作为 ChinaDNS 的上游国外服务器
使用 apt-get install dnsmasq 安装 dnsmasq
使用 vim /etc/dnsmasq.conf 编辑配置文件,添加一行 port=5353 后保存
使用 service dnsmasq restart 重启 dnsmasq 服务
设置 ChinaDNS 的上游服务器为 114.114.114.114,<SERVER_IP>:5353