1 # Copyright 2022-2024 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
8 DESCRIPTION="Chinese-specific configuration to improve your favorite DNS server."
9 HOMEPAGE="https://github.com/felixonmars/dnsmasq-china-list"
11 EGIT_REPO_URI="https://github.com/felixonmars/dnsmasq-china-list.git"
12 EGIT_MIN_CLONE_TYPE=shallow
16 IUSE="+dnsmasq smartdns dnscrypt-proxy"
20 dnsmasq? ( net-dns/dnsmasq )
21 smartdns? ( net-dns/smartdns )
22 dnscrypt-proxy? ( net-dns/dnscrypt-proxy )
27 make smartdns SERVER=china
28 rm bogus-nxdomain.china.smartdns.conf
30 if use dnscrypt-proxy; then
31 # dnscrypt-proxy won't cache the forwarded domain
32 # recommend to use systemd-resolved extra stub listener
33 # for caching china domains
34 make SERVER="127.0.0.1:5335" dnscrypt-proxy
40 insinto /etc/dnsmasq.d/
41 dobin dnsmasq-update-china-list
45 insinto /etc/smartdns/
46 doins *.china.smartdns.conf
48 if use dnscrypt-proxy; then
49 insinto /etc/dnscrypt-proxy/
50 newins dnscrypt-proxy-forwarding-rules.txt forwarding-rules.txt
55 ewarn "If you want systemd-resolved to act as a cache for dnscrypt-proxy domestic domains"
56 ewarn "edit /etc/systemd/resolved.conf.d/dnscrypt-proxy.conf:"
59 ewarn "DNSStubListener=no"
60 ewarn "DNSStubListenerExtra=udp:127.0.0.1:5335"