Commit e217283d authored by Hamza Dely's avatar Hamza Dely

Configuration pour générer les délégations du reverse IPv6

parent d1bee435
......@@ -807,6 +807,29 @@ class dns(gen_config):
print affich_tools.OK
return zones
def gen_reverse_delegation_v6(self):
"""Génération de la délégation des reverses pour les différents /64 du Crans"""
self.anim = affich_tools.anim('\tgénération des délégations du reverse IPv6 ')
zones = {}
for net in ZoneReverse.network_to_arpanets(config.prefix['subnet']):
zname = str(net)
zones[zname] = ZoneReverse(zname, self.TTL, self.gen_soa(config.dns.DNSs, self.serial, self.TTL), config.dns.DNSs)
for subnet in ZoneReverse.network_to_arpanets(config.dns.zones_reverse_v6):
subzone, length = ZoneReverse.reverse(subnet)
zone = zones[zname].get_name("%s" % subzone)
if zone:
for nameserver in config.dns.DNSs:
zones[zname].add(NS(zone, '%s.' % nameserver))
if config.dns.REVERSE_IPV6:
with update_dynamic_zone():
zones[zname].write(os.path.join(self.DNS_DIR, 'db.%s' % (zones[zname].zone_name,)))
self.anim.reinit()
print affich_tools.OK
return zones
def gen_master(self):
"""Pour le serveur maître.
......@@ -898,6 +921,7 @@ if __name__ == '__main__':
print "Serveur maître :"
CONFIG = dns()
ZONES = CONFIG.gen_tv()
ZONES.update(**CONFIG.gen_reverse_delegation_v6())
for ZONE in ZONES.values():
if ZONE.zone_name in config.dns.zones_dnssec:
if config.dns.DNSSEC_BACKEND[HOSTNAME] == 'opendnssec':
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment