CNAME records

- Recommended way to configure multiple subdomains per IP address is now via CNAME records. Notes added in README.
- Updated config.json subdomain examples to reflect how base domain is appended in code.
This commit is contained in:
Timothy Miller
2019-10-15 23:13:57 -04:00
parent 9487784876
commit f9d2ccb2ad
4 changed files with 134 additions and 4 deletions

View File

@@ -47,7 +47,8 @@ def commitRecord(ip):
"content": ip["ip"],
"proxied": c["proxied"]
}
list = cf_api("zones/" + c['zone_id'] + "/dns_records&per_page=100?type=" + ip["type"], "GET", c)
list = cf_api(
"zones/" + c['zone_id'] + "/dns_records&per_page=100?type=" + ip["type"], "GET", c)
full_subdomain = subdomain + "." + base_domain_name
dns_id = ""
for r in list["result"]:
@@ -71,7 +72,8 @@ def commitRecord(ip):
# Delete duplicate, stale records
for identifier in stale_record_ids:
print("Deleting stale record " + str(identifier))
response = cf_api("zones/" + c['zone_id'] + "/dns_records/" + identifier, "DELETE", c)
response = cf_api(
"zones/" + c['zone_id'] + "/dns_records/" + identifier, "DELETE", c)
return True