'Expected output:
Records -----
ftp.example.com.   IN A       10.0.1.1
www.example.com.   IN A       10.0.1.1
prod.example.com.   IN CNAME   www.example.com.
ipv6.example.com.   IN AAAA    dead:beef::
dev.example.com.   IN A       10.0.1.2
svn.example.com.   IN A       10.0.2.1
websrv1.example.com.   IN CNAME   prod.example.com.
blog.example.com.   IN CNAME   example.wordpress.com.'

def show_final(self):

    print ('Records    ' + ('-' * 42))
    for (name, infos) in sorted(self.records.items()):
        for (qclass, qtype, rdata) in infos:
            print ('%34s    %4s    %-7s    %s' % (name, qclass, qtype, rdata))
    '    Expected    output:\n                Hostmap    ------\n                                            ipv6.example.com    dead:beef::\n                                                ftp.example.com    10.0.1.1\n                                                www.example.com    10.0.1.1\n                                            prod.example.com\n                                websrv1.example.com\n                                                dev.example.com    10.0.1.2\n                                                svn.example.com    10.0.2.1\n                        example.wordpress.com    ?\n                                            blog.example.com\n                Domains    ---------------------------\n                                                                example.com    8\n                Networks    --------------------------\n                                                                                                            dead:beef::\n                                                                                                                        10.0.1.x\n                                                                                                                        10.0.2.1\n                '
    ipmap = defaultdict(HostInfo)
    noips = defaultdict(list)
    "\n                hostmap    =    {\n                            'www.example.com':    {'ip':    ['10.0.1.1'],    'alias':    ['prod.example.com']},\n                            'ftp.example.com':    {'ip':    ['10.0.1.1'],    'alias':    []},\n                            'prod.example.com':    {'ip':    [],    'alias':    ['websrv1.example.com']},\n                            'ipv6.example.com':    {'ip':    ['dead:beef::'],    'alias':    []},\n                            'dev.example.com':    {'ip':    ['10.0.1.2'],    'alias':    []},\n                            'example.wordpress.com':    {'ip':    [],    'alias':    ['blog.example.com']},\n\n                ipmap    =    {'10.0.1.1':    {'name':    ['www.example.com',    'ftp.example.com'],    'alias':    ['prod.example.com',    'websrv1.example.com']},    ...\n                noips    =    {'example.wordpress.com':    ['blog.example.com'],\n                "
    for (name, hinfo) in self.hostmap.items():
        for ip in hinfo.ip:
            ip = IP(ip)
            ipmap[ip].name.add(name)
            ipmap[ip].alias.update(hinfo.alias)
    for (name, hinfo) in self.hostmap.items():
        if ((not hinfo.ip) and hinfo.alias):
            found = False
            for (ip, v) in ipmap.items():
                if (name in v.alias):
                    for alias in hinfo.alias:
                        ipmap[ip].alias.add(alias)
                        found = True
            if (not found):
                noips[name].extend(hinfo.alias)
    print ('Hostmap    ' + ('-' * 42))
    for (ip, hinfo) in sorted(ipmap.items()):
        for name in hinfo.name:
            print ('%34s    %s' % (name, ip))
        for alias in hinfo.alias:
            print ('%34s' % alias)
    for (k, v) in noips.items():
        print ('%34s    ?' % k)
        for alias in v:
            print ('%34s' % alias)
    print ('Domains    ' + ('-' * 42))
    domains = {}
    for (ip, hinfo) in ipmap.items():
        for name in hinfo.name.union(hinfo.alias):
            if (name.count('.') > 1):
                i = 1
            else:
                i = 0
            d = '.'.join(name.split('.')[i:])
            if (d not in domains):
                domains[d] = 0
            domains[d] += 1
    for (domain, count) in sorted(domains.items(), key=(lambda a: a[0].split('.')[(-1)::(-1)])):
        print ('%34s    %d' % (domain, count))
    print ('Networks    ' + ('-' * 41))
    nets = {}
    for ip in set(ipmap):
        if (not (ip.version() == 4)):
            nets[ip] = [ip]
        else:
            n = ip.make_net('255.255.255.0')
            if (n not in nets):
                nets[n] = []
            nets[n].append(ip)
    for (net, ips) in sorted(nets.items()):
        if (len(ips) == 1):
            print (('    ' * 34) + ('    %s' % ips[0]))
        else:
            print (('    ' * 34) + ('    %s.x' % '.'.join(str(net).split('.')[:(-1)])))
