pymumu / smartdns

A local DNS server to obtain the fastest website IP for the best Internet experience, support DoT, DoH. 一个本地DNS服务器,获取最快的网站IP,获得最佳上网体验,支持DoH,DoT。
https://pymumu.github.io/smartdns/
GNU General Public License v3.0
8.45k stars 1.08k forks source link

ddns handling #1524

Closed IgorBai closed 1 year ago

IgorBai commented 1 year ago

Hi. Please provide some hints how to handle ddns better. E.g. my friend router has a ddns address “ddnsname.provider.com”. And that provider’s dns address is “dns.provider.com”. To faster obtain the updated IPs my smartdns shouldn’t inquire the local ISP but ask that “dns.provider.com” instead, right? So which commands are needed to make “dns.provider.com” the primary/sole dns server for “ddnsname.provider.com”, and also how to switch off dns cache for this “ddnsname.provider.com” domain?

P.S. I’ve tried some changes in /etc/config/smartdns and Luci like the one below, they didn’t work for me:

config domain-rule    
     option domain_rules /ddns.com/ --no-serve-expired
PikuZheng commented 1 year ago

I didn't understand but for ddns domain names, no-cache is a better option. You also need to choose an upstream server that does not have TTL expiration cache. In addition, if the domain name corresponds to a local intranet address, you can specify it using a static address.

IgorBai commented 1 year ago

Well, let me illusrtate. There is an outside router with dynamic IP, its domain name is idgr.dynv6.net and ddns server is dynv6.com. Currently IP is 100.100.100.100. Inside my local network both codes reply with 100.100.100.100:

  1. nslookup idgr.dynv6.net dynv6.com ----> 100.100.100.100 (correct)
  2. nslookup idgr.dynv6.net ----> 100.100.100.100 (correct)

Then I manually (in the web interface) change IP to 100.100.100.200 and the replies change:

  1. nslookup idgr.dynv6.net dynv6.com ----> 100.100.100.200 (correct)
  2. nslookup idgr.dynv6.net ----> 100.100.100.100 (wrong)

The 1st command asks the ddns provider directly and gets an immediate correct answer. The 2nd text is what the local smartdns replies (surely after some minutes the both answers will become correct - 100.100.100.200, but it takes time).

Question. How to make smartdns to instantly receive the correct new IP, without waiting for 3-5 minutes until updated information reaches other dns servers that we use? As I understand, we need to: 1) set an individual dns nameserver for our ddns domain idgr.dynv6.net and 2) switch off caching for this domain.

P.S. unfortunately in the web-documentation the code samples are very different from the present interface of smartdns.

PikuZheng commented 1 year ago

make a group, use dynv6.com as upstream and assign the ddns hostname to this group

IgorBai commented 1 year ago

Thanks, I've added the list file with my ddns hostname in Luci. And also I found how to switch caching off (same place: Domain rule list, Edit, Additional Rule Flag, -no-cache). All seem to work now. Thank you!

IgorBai commented 1 year ago

Thanks a lot.