Skip to content
Snippets Groups Projects
Commit 63c3bc6b authored by Anders Blomdell's avatar Anders Blomdell
Browse files

Add handling of hosts with same name as domain

parent 297e8269
Branches
No related tags found
No related merge requests found
......@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment