diff --git a/src/hostinfo/named.py b/src/hostinfo/named.py index f5db8fe7f233c718c33f9fe1e8ccc43d235526da..2d2e0a5973f3931ab345ff0c6543097fb28a3c43 100755 --- a/src/hostinfo/named.py +++ b/src/hostinfo/named.py @@ -197,6 +197,18 @@ class DomainDict: def generate_forward(tree, hosts): def callback(domain): result = header(tree, domain, domain) + for name,address,ttl in hosts: + if name == '%s.' % (domain): + # Host with same name as domain goes into header + if address.version == 4: + result += ('@ %-8s IN A %s' % + (ttl, str(address.exploded))) + elif address.version == 6: + result += ('@ %-8s IN AAAA %s' % + (ttl, str(address.exploded))) + pass + pass + pass for mx in [ m for m in tree._host_._interface_._mailhost_ if m.domain[0] == domain]: pri = int(mx.priority[0] or 0)