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

No IP cache used if IP is not mismatched when godns is started #136

Open
1 of 2 tasks
demifiend9 opened this issue Mar 8, 2022 · 1 comment
Open
1 of 2 tasks

Comments

@demifiend9
Copy link

Describe the bug

If the domain IP is same as current IP, godns keeps quering the api repeatedly even though IP update is not needed.

time="2022-03-08T16:32:01+05:30" level=info msg="GoDNS started, entering main loop..."
time="2022-03-08T16:32:01+05:30" level=info msg="Creating DNS handler with provider:Cloudflare"
time="2022-03-08T16:32:01+05:30" level=info msg="Checking IP for domain example.com"
time="2022-03-08T16:32:02+05:30" level=info msg="Querying records with type:AAAA"
time="2022-03-08T16:32:03+05:30" level=info msg="Record OK: gg.example.com - 2401:4900:xxxxxxxxxxxxxxxxxxxxxxx\r\n"
time="2022-03-08T16:32:03+05:30" level=info msg="Record OK: ff.example.com - 2401:4900:xxxxxxxxxxxxxxxxxxxxxxx\r\n"
time="2022-03-08T16:38:16+05:30" level=info msg="Checking IP for domain example.com"
time="2022-03-08T16:38:17+05:30" level=info msg="Querying records with type:AAAA"
time="2022-03-08T16:38:18+05:30" level=info msg="Record OK: gg.example.com - 2401:4900:xxxxxxxxxxxxxxxxxxxxxxx\r\n"
time="2022-03-08T16:38:18+05:30" level=info msg="Record OK: ff.example.com - 2401:4900:xxxxxxxxxxxxxxxxxxxxxxx\r\n"
time="2022-03-08T16:39:18+05:30" level=info msg="Checking IP for domain example.com"
time="2022-03-08T16:39:19+05:30" level=info msg="Querying records with type:AAAA"
time="2022-03-08T16:39:20+05:30" level=info msg="Record OK: gg.example.com - 2401:4900:xxxxxxxxxxxxxxxxxxxxxxx\r\n"
time="2022-03-08T16:39:20+05:30" level=info msg="Record OK: ff.example.com - 2401:4900:xxxxxxxxxxxxxxxxxxxxxxx\r\n"
time="2022-03-08T16:40:20+05:30" level=info msg="Checking IP for domain example.com"
time="2022-03-08T16:40:22+05:30" level=info msg="Querying records with type:AAAA"
time="2022-03-08T16:40:23+05:30" level=info msg="Record OK: gg.example.com - 2401:4900:xxxxxxxxxxxxxxxxxxxxxxx\r\n"
time="2022-03-08T16:40:23+05:30" level=info msg="Record OK: ff.example.com - 2401:4900:xxxxxxxxxxxxxxxxxxxxxxx\r\n"
time="2022-03-08T16:41:23+05:30" level=info msg="Checking IP for domain example.com"
time="2022-03-08T16:41:24+05:30" level=info msg="Querying records with type:AAAA"
time="2022-03-08T16:41:25+05:30" level=info msg="Record OK: gg.example.com - 2401:4900:xxxxxxxxxxxxxxxxxxxxxxx\r\n"
time="2022-03-08T16:41:25+05:30" level=info msg="Record OK: ff.example.com - 2401:4900:xxxxxxxxxxxxxxxxxxxxxxx\r\n"

Cache is made only after IP is updated once

time="2022-03-08T17:25:11+05:30" level=info msg="IP mismatch: Current(2401:4900:xxxxxxxxxxxxxxxxxxxxxxx) vs Cloudflare(2401:4900:xxxxxxxxxxxxxxxxxxxxxxx)\r\n"
time="2022-03-08T17:25:13+05:30" level=info msg="Record updated: gg.example.com - 2401:4900:xxxxxxxxxxxxxxxxxxxxxxx"
time="2022-03-08T17:25:13+05:30" level=info msg="IP mismatch: Current(2401:4900:xxxxxxxxxxxxxxxxxxxxxxx) vs Cloudflare(2401:4900:xxxxxxxxxxxxxxxxxxxxxxx)\r\n"
time="2022-03-08T17:25:14+05:30" level=info msg="Record updated: ff.example.com - 2401:4900:xxxxxxxxxxxxxxxxxxxxxxx"
time="2022-03-08T17:35:14+05:30" level=info msg="IP is the same as cached one (2401:4900:xxxxxxxxxxxxxxxxxxxxxxx). Skip update.\n"
time="2022-03-08T17:36:14+05:30" level=info msg="IP is the same as cached one (2401:4900:xxxxxxxxxxxxxxxxxxxxxxx). Skip update.\n"
time="2022-03-08T17:37:14+05:30" level=info msg="IP is the same as cached one (2401:4900:xxxxxxxxxxxxxxxxxxxxxxx). Skip update.\n"
time="2022-03-08T17:38:14+05:30" level=info msg="IP is the same as cached one (2401:4900:xxxxxxxxxxxxxxxxxxxxxxx). Skip update.\n"
time="2022-03-08T17:39:14+05:30" level=info msg="IP is the same as cached one (2401:4900:xxxxxxxxxxxxxxxxxxxxxxx). Skip update.\n"
time="2022-03-08T17:40:14+05:30" level=info msg="IP is the same as cached one (2401:4900:xxxxxxxxxxxxxxxxxxxxxxx). Skip update.\n"
time="2022-03-08T17:41:14+05:30" level=info msg="IP is the same as cached one (2401:4900:xxxxxxxxxxxxxxxxxxxxxxx). Skip update.\n"
time="2022-03-08T17:42:14+05:30" level=info msg="IP is the same as cached one (2401:4900:xxxxxxxxxxxxxxxxxxxxxxx). Skip update.\n"

The frequency of this issue

  • This issue is easy to reproduce.
  • This issue is not easy to reproduce.

Steps to Reproduce
Start godns when no ip update is needed

Expected behavior
Even if IP update is not needed when godns is started, IP cache should be made and used, to minimise the amount of api calls done.

Environment (please complete the following information):

  • DNS Provider: Cloudflare
  • OS: Windows 10
@TimothyYe
Copy link
Owner

Thanks, I'll try to reproduce it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants