timothymiller / cloudflare-ddns

🎉🌩️ Dynamic DNS (DDNS) service based on Cloudflare! Access your home network remotely via a custom domain name without a static IP!
https://timknowsbest.com/free-dynamic-dns
GNU General Public License v3.0
3k stars 316 forks source link

API error with subdomains of subdomains #156

Open tradenet opened 10 months ago

tradenet commented 10 months ago

Describe the bug cloudflare-ddns Is unable to add subdomains of subdomains eg. subdomain2.subdomain1.tld If one is added manually to cloudflare.com then an api error occurs. It appears that cloudflare-ddns keeps trying to add existing subdomains from config.json causing a loop.

To Reproduce Steps to reproduce the behavior:

  1. Go to 'cloudflare.com'
  2. Click on 'DNS --> Records'
  3. Add Record Type A 'subdomain2.subdomain1' and IP address.
  4. See error in cloudflarre-ddns logs

Log behavior 2023-10-30T19:31:45.942399795Z | result=null success=false errors=[{"code":81057,"message":"Record already exists."}] messages=[] An exception occurred while sending 'POST' request to 'zones/aa9ca73371176cf09ba5a6ecfeXxXxXX/dns_records': HTTPSConnectionPool(host='api.cloudflare.com', port=443): Max retries exceeded with url: /client/v4/zones/aa9ca73371176cf09ba5a6ecfee16d71/dns_records (Caused by NameResolutionError("<urllib3.connection.HTTPSConnection object at 0x7f2d21af2000>: Failed to resolve 'api.cloudflare.com' ([Errno -3] Try again)"))