学习笔记:使用dnscrypt-proxy搭配dnsmasq配置DNS服务器

目的:国内域名通过国内的DNS服务器(119.29.29.29)查询,国外域名通过 dnscrypt-proxy 查询

系统: Alma Linux 8

步骤:

  1. 安装dnscrypt-proxy

                yum install -y dnscrypt-proxy

  2. 配置dnscrypt-proxy

                vim /etc/dnscrypt-proxy/dnscrypt-proxy.toml

                修改项:

                        server_names = ['scaleway-fr', 'google', 'yandex', 'cloudflare']

                        listen_addresses = ['[::]:35353']

  3. 安装dnsmasq

                 yum install -y dnsmasq dnsmasq-utils

  4. 配置dnsmasq

                vim /etc/dnsmasq.conf

                修改项:

                        port=53

                        server=127.0.0.1#35353

                        conf-dir=/etc/dnsmasq.d

  5. 安装dnsmasq-china-list

GitHub - felixonmars/dnsmasq-china-list: Chinese-specific configuration to improve your favorite DNS server. Best partner for chnroutes.Chinese-specific configuration to improve your favorite DNS server. Best partner for chnroutes. - GitHub - felixonmars/dnsmasq-china-list: Chinese-specific configuration to improve your favorite DNS server. Best partner for chnroutes.https://github.com/felixonmars/dnsmasq-china-list

        安装后清理 /etc/dnsmasq.d/,仅保留一种即可

        例如,仅保留使用DNS 119.29.29.29的配置文件:

                accelerated-domains.china.119.29.29.29.conf

                apple.china.119.29.29.29.conf

                google.china.119.29.29.29.conf

                ogus-nxdomain.china.conf

附官网的安装方法:

    • Automatic Installation (recommended)

Fetch the installer from github (or a mirror): wget https://raw.githubusercontent.com/felixonmars/dnsmasq-china-list/master/install.sh

(Optional) Edit it to use your favorite DNS server and/or another mirror to download the list.

Run it as root: sudo ./install.sh

You can save the installer and run it again to update the list regularly.

    • Manual Installation

Place accelerated-domains.china.conf, bogus-nxdomain.china.conf (and optionally google.china.conf, apple.china.conf) under /etc/dnsmasq.d/ (Create the folder if it does not exist).

Uncomment "conf-dir=/etc/dnsmasq.d" in /etc/dnsmasq.conf

(Optional) Place dnsmasq-update-china-list into /usr/bin/

(Optional) Make custom DNS server configuration and/or other services' configuration.

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值