From 3a5eaaeeb54e4a28333f707c4d38804e3ab2d4d9 Mon Sep 17 00:00:00 2001 From: Thomas M Steenholdt Date: Sun, 2 Sep 2018 11:18:33 -0200 Subject: [PATCH] Allow CNAMEs to point to '@' If a CNAME records is specified to point to '@' or '', replace record data with the base domain name. --- app/models.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/models.py b/app/models.py index 1cd1733..7989a9b 100644 --- a/app/models.py +++ b/app/models.py @@ -1346,10 +1346,12 @@ class Record(object): if ':' in r['record_name']: # dirty ipv6 check r_name = r['record_name'] + r_data = domain if r_type == 'CNAME' and r['record_data'] in ['@', ''] else r['record_data'] + record = { "name": r_name, "type": r_type, - "content": r['record_data'], + "content": r_data, "disabled": True if r['record_status'] == 'Disabled' else False, "ttl": int(r['record_ttl']) if r['record_ttl'] else 3600, }