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.25k stars 1.06k forks source link

multiple server entries, what order? #1778

Open bcookatpcsd opened 1 month ago

bcookatpcsd commented 1 month ago

Alpine linux (musl), running docker

 docker exec -it smartdns smartdns -v
smartdns 1.2024.06.12-1428

smartdns.conf:

# bind [::]:53
bind 0.0.0.0:532 -force-aaa-soa -dualstack-ip-selection no -no-speed-check
bind-tcp 0.0.0.0:532 -force-aaa-soa -dualstack-ip-selection no -no-speed-check
tcp-idle-time 60

server-tls 1.1.1.1 -bootstrap-dns

server tls://one.server:853
server https://two.server/dns-query
server tls://three.server:853
server https://four.server/dns-query

cache-size 32768
cache-persist no

dualstack-ip-selection no
speed-check-mode none
socket-buff-size 1024K

max-reply-ip-num 
rr-ttl-min 600

Q: What determines the order the upstream servers are queried?

Does the query go to all defined servers, and the first response back is used?

https://pymumu.github.io/smartdns/en/configuration/

If I missed something, please let me know.

Thank you in advance.

PikuZheng commented 1 month ago

Q: What determines the order the upstream servers are queried? A: All same time except timeout

Q: Does the query go to all defined servers, and the first response back is used? A: while query a domain first time, it depends response-mode. and all upstream's result will write to cache if you set cache on.

bcookatpcsd commented 1 month ago

Thank you..

so (by default)

response-mode is first-ping

response-mode fastest-response

Q: would be the first server to respond gets their answer into the cache?

and as long as we're talking cache-size

Q: cache-size is query count, not bytes of cache?

this would be 1

drill -Q -p 532 www.google.com @127.0.0.1
142.251.215.228

and this would be seven..

drill -Q -p 532 history.google.com @127.0.0.1
history.l.google.com.
108.177.98.100
108.177.98.138
108.177.98.139
108.177.98.113
108.177.98.102
108.177.98.101

yes?

again, thank you..

PikuZheng commented 1 month ago

Q: would be the first server to respond gets their answer into the cache?

all upstram's answer will insert into the cache except invalid

Q: cache-size is query count, not bytes of cache?

neither. cache-size means domain count. but it limits by memory size