ChinaDNS-NG 项目使用教程
chinadns-ng chinadns 重构增强版,支持黑白名单,ipset/nftset 项目地址: https://gitcode.com/gh_mirrors/ch/chinadns-ng
1. 项目的目录结构及介绍
chinadns-ng/
├── chinadns-ng
├── dnsmasq-china-list
│ ├── accelerated-domains.china.conf
│ ├── apple.china.conf
│ ├── google.china.conf
│ └── README.md
├── LICENSE
├── Makefile
├── README.md
└── test
├── test.sh
└── test.txt
chinadns-ng/
: 主程序目录,包含chinadns-ng
可执行文件。dnsmasq-china-list/
: 包含中国加速域名的配置文件。accelerated-domains.china.conf
: 中国加速域名列表。apple.china.conf
: Apple 在中国加速的域名列表。google.china.conf
: Google 在中国加速的域名列表。README.md
: 该目录的说明文件。
LICENSE
: 项目的开源许可证文件。Makefile
: 用于编译项目的 Makefile 文件。README.md
: 项目的说明文件。test/
: 包含测试脚本和测试文件。test.sh
: 测试脚本。test.txt
: 测试文件。
2. 项目的启动文件介绍
chinadns-ng
是项目的启动文件,它是一个可执行文件。启动 chinadns-ng
时,可以通过命令行参数指定配置文件路径、监听端口等参数。例如:
./chinadns-ng -c /path/to/config.conf -p 5353
-c /path/to/config.conf
: 指定配置文件路径。-p 5353
: 指定监听端口。
3. 项目的配置文件介绍
chinadns-ng
的配置文件通常是一个文本文件,包含各种配置选项。以下是一个示例配置文件的内容:
# 配置文件示例
# 上游 DNS 服务器
upstream_dns1 = 8.8.8.8:53
upstream_dns2 = 1.1.1.1:53
# 中国 DNS 服务器
china_dns = 114.114.114.114:53
# 监听端口
listen_port = 5353
# 日志级别
log_level = info
upstream_dns1
和upstream_dns2
: 指定上游 DNS 服务器的地址和端口。china_dns
: 指定中国 DNS 服务器的地址和端口。listen_port
: 指定chinadns-ng
监听的端口。log_level
: 指定日志级别,可选值包括debug
,info
,warning
,error
等。
通过配置文件,用户可以灵活地配置 chinadns-ng
的行为,以满足不同的需求。
chinadns-ng chinadns 重构增强版,支持黑白名单,ipset/nftset 项目地址: https://gitcode.com/gh_mirrors/ch/chinadns-ng