diff --git a/src/hostinfo/dhcpd.py b/src/hostinfo/dhcpd.py index d0878cb44cff83c024229ee4add9ddbbeb043a8b..88f1cd8286522bb4cfca5f7d7ac3ad836c4aae9e 100755 --- a/src/hostinfo/dhcpd.py +++ b/src/hostinfo/dhcpd.py @@ -147,8 +147,8 @@ def emit_subnet(tree, n, dhcphost, kickstart): # # Emit dynamic hosts # - result += " default-lease-time 604800; # One week\n" - result += " max-lease-time 604800;\n" + result += " default-lease-time 14400; # 4 hours\n" + result += " max-lease-time 86400; # 1 day\n" dk = dynamic.keys() dk.sort() min = 0 diff --git a/src/hostinfo/named.py b/src/hostinfo/named.py index 01ee73e47ae273e957e9246ebbc291bb00353fbb..3dda21243eb7b002162f0a3c70fd47db1afc9946 100755 --- a/src/hostinfo/named.py +++ b/src/hostinfo/named.py @@ -126,6 +126,12 @@ def forward(tree, domain): host[i.name[1:]] = "A %s" % i.ip[0] for a in i._alias_: host[a.name[0]] = "CNAME %s" % i.name[1:] + for s in i._srv_: + port = int(s.port[0] or 0) + priority = int(s.priority[0] or 0) + weight = int(s.weight[0] or 0) + host[s.name[0]] = "SRV %d %d %d %s" % ( + priority, weight, port, s.name[1:]) for c in domain._cname_: # Emit cnames defined in subnet @@ -139,7 +145,7 @@ def forward(tree, domain): hk = host.keys() hk.sort() for h in hk: - result += "%-16sIN %s\n" % (h, host[h]) + result += "%-18s IN %s\n" % (h, host[h]) return result