From 0616e22e0c0b94a39a04be6a5709c5d54c562d56 Mon Sep 17 00:00:00 2001 From: Gilles Grandou Date: Mon, 16 Dec 2019 18:27:32 +0100 Subject: [PATCH] convert hostnames to lowercase --- dyndomain | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/dyndomain b/dyndomain index f53c8bf..b3d71f9 100755 --- a/dyndomain +++ b/dyndomain @@ -28,16 +28,16 @@ def load_conf(): zone_filename = conf['Files']['zonefile'] log_filename = conf['Files']['logfile'] - wan_hostname = conf['Wan']['hostname'] - zone_domain = conf['Zone']['domain'] - zone_subdomain = conf['Zone']['subdomain'] + wan_hostname = conf['Wan']['hostname'].lower() + zone_domain = conf['Zone']['domain'].lower() + zone_subdomain = conf['Zone']['subdomain'].lower() mail_from = conf['Mail']['from'] mail_to = conf['Mail']['to'] mail_ignore_list = [ host for host in conf['MailIgnore'] ] - hosts_list = [ host for host in conf['Hosts'] ] - hosts_ipv4_nat_list = [ host for host in conf['NatHosts'] ] - hosts_alias_list = conf['Aliases'] + hosts_list = [ host.lower() for host in conf['Hosts'] ] + hosts_ipv4_nat_list = [ host.lower() for host in conf['NatHosts'] ] + hosts_alias_list = [ h.lower() for h in conf['Aliases'] ] def ping(hostname): @@ -53,7 +53,7 @@ def get_ipv6_hosts(): for h in r['status']: if not 'IPv6Address' in h or not h['IPv6Address']: continue - hostname = h['Name'] + hostname = h['Name'].lower() if hostname in hosts_alias_list: hostname = hosts_alias_list[hostname] for a in h['IPv6Address']: @@ -105,7 +105,7 @@ def read_zone_list_from_file(zone_filename): for host in config: for p in config[host]: for target in config[host][p].split('\n'): - zone_list.append([host, p.upper(), target]) + zone_list.append([host.lower(), p.upper(), target]) return zone_list