ddns-updater icon indicating copy to clipboard operation
ddns-updater copied to clipboard

Bug: IPv6 fetched when using `"ip_version": "ipv4"`

Open yefenghu opened this issue 3 years ago • 3 comments

image this is my log:

stdout: 2021/10/29 16:07:01 INFO reading JSON config from file /updater/data/config.json
stdout: 2021/10/29 16:07:01 INFO Found single setting to update record
stdout: 2021/10/29 16:07:05 INFO Reading history from database: domain yefenghu.* host @
stdout: 2021/10/29 16:07:05 INFO backup: disabled
stdout: 2021/10/29 16:07:05 INFO healthcheck server: listening on 127.0.0.1:9999
stdout: 2021/10/29 16:07:05 INFO http server: listening on :8000
stdout: 2021/10/29 16:12:05 WARN obtaining ipv4 address: try 1 of 3: no TXT record found
stdout: 2021/10/29 16:12:06 INFO obtaining ipv4 address: succeeded after 2 tries
stdout: 2021/10/29 16:17:05 INFO IPv4 address of yefenghu.* is 175.11.*.* and your IPv4 address is 240e:5a:*:0:114:114:114:102
stdout: 2021/10/29 16:17:05 INFO Updating record [domain: yefenghu.* | host: @ | provider: Porkbun] to use 240e:5a:6805:0:114:114:114:102
stdout: 2021/10/29 16:27:05 WARN obtaining ipv4 address: try 1 of 3: no TXT record found
stdout: 2021/10/29 16:27:05 INFO obtaining ipv4 address: succeeded after 2 tries
stdout: 2021/10/29 16:32:05 INFO IPv4 address of yefenghu.* is 175.11.*.* and your IPv4 address is 240e:5a*:0:114:114:114:102
stdout: 2021/10/29 16:32:05 INFO Updating record [domain: yefenghu.* | host: @ | provider: Porkbun] to use 240e:5a:6805:0:114:114:114:102
stdout: 2021/10/29 16:32:07 ERROR bad HTTP status: 400: {"status":"ERROR","message":"Edit error: We were unable to edit the DNS record."}
stdout: 2021/10/29 19:32:05 INFO IPv4 address of yefenghu.cyou is 175.11.*.* and your IPv4 address is 58.217..
stdout: 2021/10/29 19:32:05 INFO Updating record [domain: yefenghu.* | host: @ | provider: Porkbun] to use 58.217..
stdout: 2021/10/29 19:32:07 ERROR bad HTTP status: 400: {"status":"ERROR","message":"Edit error: We were unable to edit the DNS record."}
stdout: 2021/10/29 19:42:05 WARN obtaining ipv4 address: try 1 of 3: no TXT record found

175.11.*.* is correct , 240e:5a*:0:114:114:114:102 i do not konw what it from,then 240e:5a*:0:114:114:114:102 change into 58.217.*.*,i do not anything .need to solve it ?

yefenghu avatar Oct 30 '21 12:10 yefenghu

Maybe you do not have an IPv4 address assigned at all, and only an IPv6 address? 🤔

qdm12 avatar Jan 21 '22 12:01 qdm12

Also which version are you running? (you can check the commit hash at the top of your logs)

qdm12 avatar Jan 21 '22 13:01 qdm12

Not OP but I am having the same issue - commit hash is 584597d

I have two ddns-updater containers, and this only happens on the one that is bound to a VPN network, so it's likely related to that. But the VPN tunnel is configured to use ipv4 only.

Also not sure what is going on with my hostname resolving to nil half the time (consistently every other time throughout my logs)

Let me know if I can test anything or provide any more information - thanks!

today at 9:24:22 AM2022/05/03 09:24:22 INFO reading JSON config from file /updater/data/config.json
today at 9:24:22 AM2022/05/03 09:24:22 INFO Found single setting to update record
today at 9:24:22 AM2022/05/03 09:24:22 INFO Reading history from database: domain m*******.com host @
today at 9:24:22 AM2022/05/03 09:24:22 INFO backup: disabled
today at 9:24:22 AM2022/05/03 09:24:22 INFO healthcheck server: listening on 127.0.0.1:9999
today at 9:24:22 AM2022/05/03 09:24:22 INFO http server: listening on :8000
today at 9:29:22 AM2022/05/03 09:29:22 WARN obtaining ipv4 address: try 1 of 3: no TXT record found
today at 9:29:23 AM2022/05/03 09:29:23 INFO obtaining ipv4 address: succeeded after 2 tries
today at 9:34:22 AM2022/05/03 09:34:22 INFO IPv4 address of m*******.com is 143.*.*.89 and your IPv4 address is 2a02:****:****:1::b51d
today at 9:34:22 AM2022/05/03 09:34:22 INFO Updating record [domain: m*******.com | host: @ | provider: google | ip: ipv4] to use 2a02:****:****:1::b51d
today at 9:34:24 AM2022/05/03 09:34:24 ERROR mismatching IP address received: 2a02:****:****:1::
today at 9:39:23 AM2022/05/03 09:39:23 INFO IPv4 address of m*******.com is <nil> and your IPv4 address is 143.*.*.89
today at 9:39:23 AM2022/05/03 09:39:23 INFO Updating record [domain: m*******.com | host: @ | provider: google | ip: ipv4] to use 143.*.*.89
today at 9:44:22 AM2022/05/03 09:44:22 WARN obtaining ipv4 address: try 1 of 3: no TXT record found
today at 9:44:23 AM2022/05/03 09:44:23 INFO obtaining ipv4 address: succeeded after 2 tries
today at 9:49:22 AM2022/05/03 09:49:22 INFO IPv4 address of m*******.com is 143.*.*.89 and your IPv4 address is 2a02:****:****:1::b51d
today at 9:49:22 AM2022/05/03 09:49:22 INFO Updating record [domain: m*******.com | host: @ | provider: google | ip: ipv4] to use 2a02:****:****:1::b51d
today at 9:49:24 AM2022/05/03 09:49:24 ERROR mismatching IP address received: 2a02:****:****:1::
today at 9:54:23 AM2022/05/03 09:54:23 INFO IPv4 address of m*******.com is <nil> and your IPv4 address is 143.*.*.89
today at 9:54:23 AM2022/05/03 09:54:23 INFO Updating record [domain: m*******.com | host: @ | provider: google | ip: ipv4] to use 143.*.*.89
today at 9:59:22 AM2022/05/03 09:59:22 WARN obtaining ipv4 address: try 1 of 3: no TXT record found
today at 9:59:23 AM2022/05/03 09:59:23 INFO obtaining ipv4 address: succeeded after 2 tries

crafty35a avatar May 03 '22 18:05 crafty35a

Can you try pulling the latest image and try again?

  • IPv4/IPv6 extraction fixed/changed in 954dffd3a78751061c01e0f9135086a306f57dc2
  • IP handling changed in 9a4a268926c73f360578cf4a2a9d75a156541250

Maybe both will fix the bug you're seeing, let me know, otherwise I'll investigate further.

qdm12 avatar Jun 13 '23 07:06 qdm12

Closing due to inactivity, feel free to comment if you encounter the problem again.

qdm12 avatar Jan 19 '24 20:01 qdm12