33

GitHub - aa65535/openwrt-chinadns: ChinaDNS for OpenWrt/LEDE

 4 years ago
source link: https://github.com/aa65535/openwrt-chinadns
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

ChinaDNS for OpenWrt

本项目是 ChinaDNS 在 OpenWrt 上的移植

  • 从 OpenWrt 的 SDK 编译

    # 以 ar71xx 平台为例
    tar xjf OpenWrt-SDK-ar71xx-for-linux-x86_64-gcc-4.8-linaro_uClibc-0.9.33.2.tar.bz2
    cd OpenWrt-SDK-ar71xx-*
    # 获取 Makefile
    git clone https://github.com/aa65535/openwrt-chinadns.git package/chinadns
    # 选择要编译的包 Network -> ChinaDNS
    make menuconfig
    # 开始编译
    make package/chinadns/compile V=99
  • 默认 DNS 服务器端口为 5353, 可使用 LuCI 进行配置

  • 可搭配路由器自带的 Dnsmasq 使用 借助其 DNS 缓存提升查询速度

    LuCI 中定位至「网络 - DHCP/DNS」
    「基本设置」 本地服务器 填写 127.0.0.1#5353
    「HOSTS和解析文件」勾选 忽略解析文件

  • 不要在 ChinaDNS 的上游使用带 DNS 缓存的本地服务器, 可能无法得到预期效果

  • 遇到 UDP 不稳定的情况, 建议使用 DNS-Forwarder 将 DNS 查询转换为 TCP 协议

    ChinaDNS 的上游 DNS 服务器使用 DNS-Forwarder 即可, 配置方法参考 Wiki

  • 更新 /etc/chinadns_chnroute.txt

     wget -O- 'http://ftp.apnic.net/apnic/stats/apnic/delegated-apnic-latest' | awk -F\| '/CN\|ipv4/ { printf("%s/%d\n", $4, 32-log($5)/log(2)) }' > /etc/chinadns_chnroute.txt

Name Description openwrt-dnsmasq Dnsmasq Patch & Makefile for OpenWrt openwrt-shadowsocks Shadowsocks-libev for OpenWrt openwrt-shadowvpn ShadowVPN for OpenWrt openwrt-dist-luci LuCI Applications for OpenWrt-dist openwrt-redsocks2 RedSocks2 for OpenWrt

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK