From 241f28df1728ed9d2dacd4120e7043e415513554 Mon Sep 17 00:00:00 2001 From: Anders Blomdell <anders.blomdell@control.lth.se> Date: Mon, 7 May 2012 11:27:57 +0200 Subject: [PATCH] Version 2012-05-07 11:27 M src/hostinfo/named.py --- src/hostinfo/named.py | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/src/hostinfo/named.py b/src/hostinfo/named.py index 353c847..68b499d 100755 --- a/src/hostinfo/named.py +++ b/src/hostinfo/named.py @@ -133,6 +133,23 @@ def forward(tree, domain): pri = int(m.priority[0] or 0) result += "%-16sIN MX %d %s\n" % ("", pri ,fqn(tree, m._parent)) result += ";\n" + + # Add domain TXT entries + newline = False + for t in tree._subnet_._txt_: + if t.domain[1] == domain.domain[0]: + result += ' IN TXT "%s"\n' % ( + t.value[0]) + newline = True + pass + pass + if newline: + result += ";\n" + pass + + # Add a localhost entry + result += "localhost IN A 127.0.0.1\n" + result += ";\n" host = {} def add_entry(name, kind, value): @@ -172,10 +189,6 @@ def forward(tree, domain): add_entry(c.alias[0], 'CNAME', '%s' % c.name[0]) pass - # Add a localhost entry - result += "localhost IN A 127.0.0.1\n" - result += ";\n" - # Add hosts for h1 in sorted(host): for k,v in sorted(host[h1]): -- GitLab