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 220 forks source link

Cloudflare Provider: root domain does not update #176

Closed WesleyBatista closed 2 years ago

WesleyBatista commented 2 years ago

Describe the bug
Root domain not being updated when specifying "@" in sub_domains in a yaml configuration file using Cloudflare as provider.

The frequency of this issue

Steps to Reproduce

godns -c=/etc/godns/config.yaml

Your GoDNS configuration

debug_info: false
domains:
- domain_name: example.com
  sub_domains:
  - sub1
  - sub2
  - "@"
interval: 300
ip_interface: eth0
ip_type: IPv4
ip_url: https://api.ipify.org
ipv6_url: https://ipify.org
login_token: xxxxxxxxxxxxxxx
notify:
  mail:
    enabled: false
    send_to: null
    smtp_password: null
    smtp_port: 25
    smtp_server: null
    smtp_username: null
  telegram:
    bot_api_key: null
    chat_id: null
    enabled: false
    message_template: null
password: null
provider: Cloudflare
resolver: 1.1.1.1
socks5_proxy: null
use_proxy: false
user_agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.111 Safari/537.36
webhook:
  enabled: false
  url: http://localhost:5000/api/v1/send

Expected behavior
As stated in README.md:

Environment (please complete the following information):

Additional context

Using godns v2.8.7.

This is the output:

...
godns[54463]: time="2022-08-04T22:56:56Z" level=info msg="Record OK: sub2.example.com - XX.XX.XXX.XXX"
godns[54463]: time="2022-08-04T22:56:56Z" level=info msg="Checking IP for domain example.com"
godns[54463]: time="2022-08-04T22:56:57Z" level=info msg="Querying records with type: A"
godns[54463]: time="2022-08-04T22:56:59Z" level=info msg="Response failed: {\"result\":null,\"success\":false,\"errors\":[{\"code\":1004,\"message\":\"DNS Validation Error\",\"error_chain\":[{\"code\":9000,\"message\":\"DNS name is invalid.\"}]}],\"messages\":[]}"
godns[54463]: time="2022-08-04T22:56:59Z" level=error msg="failed to create record: {\"result\":null,\"success\":false,\"errors\":[{\"code\":1004,\"message\":\"DNS Validation Error\",\"error_chain\":[{\"code\":9000,\"message\":\"DNS name is invalid.\"}]}],\"messages\":[]}"
TimothyYe commented 2 years ago

Thanks for the feedback, this issue has been fixed by release v2.8.8

WesleyBatista commented 2 years ago

Amazing, it works! thank you again :)