smartdns icon indicating copy to clipboard operation
smartdns copied to clipboard

有办法区分国内域名和国外域名?

Open hel2o opened this issue 1 month ago • 1 comments

需求应用场景 我外网有国际线路和国内电信线路,想实现如果访问的国外域名就直接使用国外的DNS解析,解析出来国外的IP就会正常走国际线路

建议的方案 在检测ping时是否可以指定DNS从哪个网卡或者源IP出发ping去探测?

hel2o avatar Nov 04 '25 09:11 hel2o

Pull Request Test Coverage Report for Build 17795654203

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 7 of 7 (100.0%) changed or added relevant lines in 2 files are covered.
  • 18 unchanged lines in 6 files lost coverage.
  • Overall coverage increased (+0.03%) to 66.037%

Files with Coverage Reduction New Missed Lines %
pdns/recursordist/syncres.cc 1 81.25%
modules/godbcbackend/sodbc.cc 2 70.13%
pdns/recursordist/rec-main.cc 2 64.68%
pdns/rcpgenerator.cc 3 90.56%
pdns/dnsdistdist/dnsdist-lbpolicies.cc 4 72.36%
pdns/recursordist/pdns_recursor.cc 6 73.64%
<!-- Total: 18
Totals Coverage Status
Change from base Build 17789672259: 0.03%
Covered Lines: 128910
Relevant Lines: 166497

💛 - Coveralls

coveralls avatar Jul 09 '25 10:07 coveralls

Please have some patience. We are certainly considering this, but first we need to finish the 5.3.0 release.

omoerbeek avatar Aug 18 '25 06:08 omoerbeek

Please have some patience. We are certainly considering this, but first we need to finish the 5.3.0 release.

No problem, I did expect to wait until the release, and I've been on vacation anyway.

elenril avatar Aug 27 '25 15:08 elenril

I rebased the code and added a fix for when the new remote is TCP and port 853, it should switch to DoT if needed. This PR will need a test.

omoerbeek avatar Sep 17 '25 11:09 omoerbeek

As I suspected, there's an issue with the nsspeed bookkeeping: the original IP stays in the table at 0ms, while the updated IP gets an entry > 0ms. The speed based selection mechanism then keeps selecting the fast 0ms entry, which is never updated, basically breaking the mechanism that selects the fastest nameserver.

omoerbeek avatar Sep 18 '25 10:09 omoerbeek