From 205495d2d44df6b1759399a83fe338fad8fc57f1 Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Wed, 7 Feb 2018 09:09:58 +0100 Subject: [PATCH] Warn for possible broken CNAMEs Signed-off-by: Knut Ahlers --- checkZonefile.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/checkZonefile.py b/checkZonefile.py index c9c03a9..c8c741d 100644 --- a/checkZonefile.py +++ b/checkZonefile.py @@ -66,6 +66,11 @@ def check_entry(zone_name, entry): warn('Zone "{}" - Entry "{}" - Resolved to 0 resource records!'.format( zone_name, entry['name'])) + for entry in parsed_entries: + if entry['type'] == 'CNAME' and entry['data'][-1] != '.': + warn('Zone "{}" - Entry "{}" - CNAME data has no ending dot, pointing to same domain.'.format( + zone_name, entry['name'])) + # TODO(kahlers): Add more checks: # - Type is valid # - Class is valid