{"repo":"217heidai/NestingDNS","free":true,"listed":false,"github":"https://github.com/217heidai/NestingDNS","clone":"git clone https://github.com/217heidai/NestingDNS.git","description":"AdGuardHome、MosDNS、SmartDNS 套娃使用实践","language":"Shell","stars":359,"topics":["adguardhome","docker","mosdns","smartdns"],"license":"GPL-3.0","category":"deployment-docker-iac","readme_excerpt":"NestingDNS DNS 三大神器 AdGuardHome、MosDNS、SmartDNS，该如何选择？ 不，小孩子才做选择，我全都要。 于是有了这个项目，套娃使用三大神器，试图找到一套最佳实践。 DNS 解析流程 1. AdGuardHome 为第一层 DNS ，作为整体入口，监听端口 4053。 - 负责去广告。 2. MosDNS 为第二层 DNS，监听端口 5053。 - 负责分流。 - 直连：待解析域名在 direct.txt、direct custom.txt(自定义直连域名)内，通过 SmartDNS 的 mainland 组进行解析。 - 代理：待解析域名在 proxy.txt、proxy custom.txt(自定义代理域名)内，通过 SmartDNS 的 gfw 组进行解析。 - Fallback：待解析域名不在以上规则内的，先使用 SmartDNS 的 mainland 组进行解析，如解析出来的地址为国内 IP(在 ipv4 china.txt 内)则使用，否则抛弃。再使用 SmartDNS 的 gfw 组进行解析，如解析成功则使用，如失败则使用 SmartDNS 的 overseas 组进行解析（gfw 组使用代理连接公共 DNS，当代理异常时使用 overseas 组作为备用进行解析）。 3. SmartDNS 为第三层 DNS，监听端口 6053、7053、8053 - 负责 DNS 解析、测速、缓存。 - mainland 组，端口 7053，通过 DoH 接入上游 AliDNS(DoQ)、DNSPod、360DNS、Quad101，负责直连域名解析。 - gfw 组，端口 8053，通过代理使用 DoH 接入上游 Google、Cloudflare、Quad9、DNS.SB、OpenDNS，负责代理域名解析，关闭缓存、测速。 - overseas 组，端口 6053，通过 DoH 接入上游 Google、Cloudflare、Quad9、DNS.SB、OpenDNS、Quad101，作为备用域名解析，关闭缓存、测速。 安装方法 使用 Docker 一键安装。 1. network host 模式（推荐使用） 2. 端口映射模式（MosDNS、SmartDNS 的端口可以不映射） 配置说明 默认已全部关闭 IPv6 支持。 AdGuardHome AdGuardHome 配置文件为 $HOME/nestingdns/etc/conf/adguardhome.yaml 。 - 默认已配置好，一般无需调整 。 - 默认开启缓存，并关闭乐观缓存，AdGuardHome 仅作临时缓存。主要缓存功能由 SmartDNS 负责。 - 默认内置去广告规则 AdBlock DNS Filters。 - web 服务为 3000 端口，默认账号 root 密码 password。 MosDNS MosDNS 配置文件为 $HOME/nestingdns/etc/conf/mosdns.yaml 、 $HOME/nestingdns/etc/conf/mosdns load rules.yaml 、 $HOME/nestingdns/etc/conf/mosdns forward.yaml 。 - 默认已配置好，一般无需调整 。各项配置可参考官方 wiki。 - 分流规则文件路径为 $HOME/nestingdns/etc/site/ 。根据创建容器时的 SCHEDULE 参数，定时下载更新分流规则文件，默认每天 4 点更新。 - ","default_branch":null,"files":null,"tree":[],"storefront":"/r/217heidai","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/217heidai/NestingDNS/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}