#2455·smartdns

多个海外出口 DNS

作者: rumij创建于 2026年8月25日更新于 2026年8月25日

**Problem symptoms** Currently, there are 10 overseas exports, 10 upstream addresses, and different users use different overseas exports. According to different source addresses, the DNS side divides users into groups. That is, the UK source address uses the UK DNS request, but an additional overseas domain table is also required to resolve the request to the overseas. How should I configure this? Here is my configuration file: # International upstream DNS groups. # Add "-interface <interface-name>" or "-set-mark <routing-mark>" to each line when the DNS query itself must be forced through a particular egress. server India -group India -exclude-default-group server Turkey -group Turkey -exclude-default-group server Germany -group Germany -exclude-default-group server Jakarta -group Jakarta -exclude-default-group server Singapore -group Singapore -exclude-default-group server US -group US -exclude-default-group server HK -group HK -exclude-default-group server Japan -group Japan -exclude-default-group # Domain sets. domain-set -name overseas -file /etc/smartdns/ad-list.conf domain-set -name feishu -file /etc/smartdns/feishu.conf # Client source-address files: one client IP/CIDR may belong to one file only. ip-set -name users-india -file /etc/smartdns/users/india.conf ip-set -name users-turkey -file /etc/smartdns/users/turkey.conf ip-set -name users-germany -file /etc/smartdns/users/germany.conf ip-set -name users-jakarta -file /etc/smartdns/users/jakarta.conf ip-set -name users-singapore -file /etc/smartdns/users/singapore.conf ip-set -name users-us -file /etc/smartdns/users/us.conf ip-set -name users-hk -file /etc/smartdns/users/hk.conf ip-set -name users-japan -file /etc/smartdns/users/japan.conf # Client source address -> egress DNS group. client-rules ip-set:users-india -group India client-rules ip-set:users-turkey -group Turkey client-rules ip-set:users-germany -group Germany client-rules ip-set:users-jakarta -group Jakarta client-rules ip-set:users-singapore -group Singapore client-rules ip-set:users-us -group US client-rules ip-set:users-hk -group HK client-rules ip-set:users-japan -group Japan # A client selected into a group uses only that group's upstream DNS when the queried domain matches the overseas domain set. All other domains inherit the default DNS rules above. group-begin India -inherit default nameserver /domain-set:overseas/India group-end group-begin Turkey -inherit default nameserver /domain-set:overseas/Turkey group-end group-begin Germany -inherit default nameserver /domain-set:overseas/Germany group-end group-begin Jakarta -inherit default nameserver /domain-set:overseas/Jakarta group-end group-begin Singapore -inherit default nameserver /domain-set:overseas/Singapore group-end group-begin US -inherit default nameserver /domain-set:overseas/US group-end group-begin HK -inherit default nameserver /domain-set:overseas/HK group-end group-begin Japan -inherit default nameserver /domain-set:overseas/Japan group-end # Feishu domains always use the Feishu DNS group. nameserver /domain-set:feishu/feishu force-qtype-SOA 65 audit-enable yes audit-num 16 audit-size 16M audit-file

内容来源: pymumu/smartdns