TimothyYe / godns

A dynamic DNS client tool that supports AliDNS, Cloudflare, Google Domains, DNSPod, HE.net & DuckDNS & DreamHost, etc, written in Go.
https://timothyye.github.io/godns/
Apache License 2.0
1.5k stars 221 forks source link

Need retry for failed updates #23

Closed sbrudenell closed 5 years ago

sbrudenell commented 6 years ago

The current behavior seems to be that if a record update ever fails, that record will stay failed, and will never be retried until the IP changes.

HE.net updates seem to fail fairly often.

Example logs:

godns_1                   | 【GoDNS】2018/06/12 05:11:02 GoDNS started, entering main loop...
godns_1                   | 【GoDNS】2018/06/12 05:11:02 Creating DNS handler with provider: HE
godns_1                   | 【GoDNS】2018/06/12 05:11:03 currentIP is: x.x.x.x
godns_1                   | 
godns_1                   | 【GoDNS】2018/06/12 05:11:03 a.redacted.com Start to update record IP...
godns_1                   | 【GoDNS】2018/06/12 05:11:03 Update IP success: nochg x.x.x.x
godns_1                   | 【GoDNS】2018/06/12 05:11:03 b.redacted.com Start to update record IP...
godns_1                   | 【GoDNS】2018/06/12 05:11:03 Request error...
godns_1                   | 【GoDNS】2018/06/12 05:11:03 Err: Post https://dyn.dns.he.net/nic/update: EOF
godns_1                   | 【GoDNS】2018/06/12 05:11:03 c.redacted.com Start to update record IP...
godns_1                   | 【GoDNS】2018/06/12 05:11:03 Request error...
godns_1                   | 【GoDNS】2018/06/12 05:11:03 Err: Post https://dyn.dns.he.net/nic/update: EOF
godns_1                   | 【GoDNS】2018/06/12 05:11:03 Going to sleep, will start next checking in 5 minutes...
godns_1                   | 【GoDNS】2018/06/12 05:16:05 currentIP is: x.x.x.x
godns_1                   | 
godns_1                   | 【GoDNS】2018/06/12 05:16:05 Current IP is not changed, no need to update...
godns_1                   | 【GoDNS】2018/06/12 05:16:05 Going to sleep, will start next checking in 5 minutes...
TimothyYe commented 6 years ago

Hi @sbrudenell, is it cause by poor network condition? I need to find a way to reproduce this issue.

sbrudenell commented 6 years ago

I have a gigabit fiber connection; I don't believe it's caused by poor network conditions.

It's extremely repeatable. About 50% of my record updates fail with he.net.

Most other ddns updater programs have an option to force an update once every so often (commonly once an hour), so records are eventually correct.

TimothyYe commented 5 years ago

@sbrudenell Sorry for my late reply, I've tried it, but cannot reproduce it.