Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

判断是否向dns服务商发起请求逻辑疑问! #1254

Closed
2 tasks done
Black-Gold opened this issue Sep 17, 2024 · 7 comments
Closed
2 tasks done

判断是否向dns服务商发起请求逻辑疑问! #1254

Black-Gold opened this issue Sep 17, 2024 · 7 comments
Labels
enhancement New feature or request

Comments

@Black-Gold
Copy link

Black-Gold commented Sep 17, 2024

Description

当前判断逻辑是从IPcache比对IP并设置次数阈值。但此方式感觉不是很合理,是否可以简单一些,比对IPcache中IP与获取到的最新IP不匹配时再去调用dns服务商接口进行更新dns解析记录?即只有当IP真正变更时再去修改解析记录。这样每个月请求dns服务商接口10次左右,完全不会产生任何费用!

Problem

当前逻辑在IP未实际变更时,仍然会调用dns服务商接口。go语言小白,理解如有问题,欢迎赐教!@jeessy2

Other Description

No response

Checklist

  • I am using the latest version and have confirmed that the feature is not yet implemented in the latest version
  • I have searched for similar feature requests before submitting this one
@Black-Gold Black-Gold added the enhancement New feature or request label Sep 17, 2024
@Black-Gold Black-Gold changed the title 判断是否向dns服务商发起请求逻辑请求变更! 判断是否向dns服务商发起请求逻辑疑问! Sep 17, 2024
@jeessy2
Copy link
Owner

jeessy2 commented Sep 18, 2024

可以设置的,参考首页说明

@Black-Gold
Copy link
Author

可以设置的,参考首页说明

你说的是:-cacheTimes 间隔N次与服务商比对这个吧!但是我不理解与服务商比对有什么作用?只需要比对IPCache中是否与获取到的最新IP进行比对不就可以了吗?如果IPCache中和最新IP不一致,再去请求dns服务商接口进行更新解析即可!

@jeessy2
Copy link
Owner

jeessy2 commented Sep 18, 2024

比如这哥们#1250

@Black-Gold
Copy link
Author

比如这哥们#1250

这哥们问题应该不是ddns-go的问题,我认为是他自己的问题!如果按照现有逻辑来处理,假如IP未实际变更的情况下,每隔一段时间仍会请求服务商接口。如果真的需要此功能,是否考虑增加一个类似开关功能,而不是用户自行设置cacheTimes?如果可以我愿意在大佬指导下,完成此功能!

@jeessy2
Copy link
Owner

jeessy2 commented Sep 18, 2024

这样就可以了,不用在实现什么功能

@Black-Gold
Copy link
Author

但是这样的话,即使在IP未实际变更时,仍会请求dns服务商进行比对操作,对于一些厂商免费次数太少很容易就超了会导致产生费用!白嫖到底啊!哥们

@jeessy2
Copy link
Owner

jeessy2 commented Sep 18, 2024

默认30分钟一次,暂时没遇到有那些服务商限流。即使被限制了,可设置参数为9999

@jeessy2 jeessy2 closed this as completed Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants