Skip to content
Discussion options

You must be logged in to vote

首先 您要认识dns内每笔资料都有一个TTL设定, 全名是 time to live, 用途就是通知每个客户这个纪录有效时间是多少(单位通常是"秒")

假如您的 www.example.com 在ddns最後更新时间是 00:00:01 零时零分01秒 TTL 是 300(即5分钟)

如 客户A 在 00:00:02 查询, 在每级的dns, 包括您公司的wifi router或您最终的手机也会纪录
在 00:00:02 - 00:05:02 都是有效, 在有效时间内, 不会再向上级dns查询 直至超时
如 00:05:03或以後, 如再次查询 因之前的纪录已超时, 便会向 上级dns再查询.

但 如客户B 在 00:04:59 查询, 他的有效时间便会是 00:04:59 - 00:09:59

但 如您的 www.example.com 在ddns最後更新时间是 00:04:30
这时 客户A因还没更新到最新 IP, 所以在 00:04:30 - 00:05:01 是会连接不到。 直至 00:05:02重新向上级dns再查询才会回复正常。
这就是你所说的 缓存.
就算您的手机或您上级的wifi router dns都取消缓存也解决不了您的请况, 因您的dns服务公司也有他们的dns缓存.

解说完, 如何解决?
完全解决可以是有 也可以是没有。

如您有多於一台伺服器做 load balancing, 问题就可解决

但如只得一台 只能在ddns内的ttl尽可能小(但一般ddns最小通常都是300s或180s)
这也有不能连接时间。 只能尽量可能小.

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@snail2sky
Comment options

Answer selected by snail2sky
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants