diff --git a/cloudflare-ddns.py b/cloudflare-ddns.py index 17fa404..05a7d6b 100755 --- a/cloudflare-ddns.py +++ b/cloudflare-ddns.py @@ -49,7 +49,11 @@ def commitRecord(ip): } list = cf_api( "zones/" + c['zone_id'] + "/dns_records&per_page=100?type=" + ip["type"], "GET", c) - full_subdomain = subdomain + "." + base_domain_name + + full_subdomain = base_domain_name + if subdomain: + full_subdomain = subdomain + "." + full_subdomain + dns_id = "" for r in list["result"]: if (r["name"] == full_subdomain):