diff --git a/src/hostinfo/named.py b/src/hostinfo/named.py
index 34cf055b83e53ce5dfc4013bbff83dc20a81d33b..f346e755b4f6f66ebe1a12f3987b389261795ff0 100755
--- a/src/hostinfo/named.py
+++ b/src/hostinfo/named.py
@@ -127,6 +127,15 @@ def header(tree, domain, origin=None):
util.fqn(tree, ns._parent))
pass
pass
+ delegation = []
+ for ns in tree._host_._interface_._nameserver_:
+ subdomain = ns.domain[0].split('.')
+ if subdomain[1:] == domain.split('.'):
+ delegation.append( '%-16sIN NS %s' %
+ (subdomain[0], util.fqn(tree, ns._parent)))
+
+ for d in sorted(delegation):
+ result += d
result += ";"
return result