[dns] On utilise un dictionnaire pour les dns recursifs
This commit is contained in:
parent
f31d79e63f
commit
5e76ac1ad0
4 changed files with 13 additions and 13 deletions
|
@ -81,7 +81,7 @@ if has("dns-recursif") and not has("dns-secondary-no-forward"):
|
||||||
|
|
||||||
elif has("dns-forward-only"):
|
elif has("dns-forward-only"):
|
||||||
@forward only;
|
@forward only;
|
||||||
print "forwarders { %s; };" % '; '.join(config.dns.recursiv_adm)
|
print "forwarders { %s; };" % '; '.join(config.dns.recursiv['adm'])
|
||||||
|
|
||||||
@// anti SPAM
|
@// anti SPAM
|
||||||
@// Rajout pour generer le forward vers ariane pour la zone rbl-plus.mail-abuse.org --Nico 21/04/02
|
@// Rajout pour generer le forward vers ariane pour la zone rbl-plus.mail-abuse.org --Nico 21/04/02
|
||||||
|
|
|
@ -14,9 +14,12 @@ def notify(ips):
|
||||||
print " also-notify { \n %s;\n };" % ';\n '.join(ips)
|
print " also-notify { \n %s;\n };" % ';\n '.join(ips)
|
||||||
|
|
||||||
|
|
||||||
|
allowed = set()
|
||||||
|
|
||||||
if has("dns-primary"):
|
if has("dns-primary"):
|
||||||
notify(config.dns.slaves + config.dns.parents)
|
allowed = allowed.union(config.dns.slaves + config.dns.parents)
|
||||||
elif has("dns-tv"):
|
if has("dns-tv"):
|
||||||
notify(config.dns.slaves_tv + config.dns.recursiv)
|
allowed = allowed.union(config.dns.slaves_tv + config.dns.recursiv['adm'])
|
||||||
|
if allowed:
|
||||||
|
allowed = list(allowed)
|
||||||
|
allowed.sort()
|
||||||
|
notify(allowed)
|
||||||
|
|
|
@ -57,7 +57,7 @@ if has("dns-primary") or has("dns-tv"):
|
||||||
if has("dns-primary"):
|
if has("dns-primary"):
|
||||||
allowed = allowed.union(config.dns.slaves + config.dns.parents)
|
allowed = allowed.union(config.dns.slaves + config.dns.parents)
|
||||||
if has("dns-tv"):
|
if has("dns-tv"):
|
||||||
allowed = allowed.union(config.dns.slaves_tv + config.dns.recursiv_adm)
|
allowed = allowed.union(config.dns.slaves_tv + config.dns.recursiv['adm'])
|
||||||
if allowed:
|
if allowed:
|
||||||
allowed = list(allowed)
|
allowed = list(allowed)
|
||||||
allowed.sort()
|
allowed.sort()
|
||||||
|
|
|
@ -9,9 +9,6 @@ info["perms"] = 0644
|
||||||
|
|
||||||
import config.dns
|
import config.dns
|
||||||
|
|
||||||
nameservers = ' '.join(config.dns.recursiv)
|
|
||||||
nameservers_adm = ' '.join(config.dns.recursiv_adm)
|
|
||||||
|
|
||||||
header("""
|
header("""
|
||||||
Les modifications locales sont a mettre dans le fichier /etc/network/interfaces.local
|
Les modifications locales sont a mettre dans le fichier /etc/network/interfaces.local
|
||||||
|
|
||||||
|
@ -35,7 +32,7 @@ iface %(interface)s inet static
|
||||||
broadcast 138.231.143.255
|
broadcast 138.231.143.255
|
||||||
gateway 138.231.136.4
|
gateway 138.231.136.4
|
||||||
dns-nameservers %(nameservers)s
|
dns-nameservers %(nameservers)s
|
||||||
dns-search crans.org""" % { 'interface': interface, 'ip': pubip(), 'nameservers': nameservers }
|
dns-search crans.org""" % { 'interface': interface, 'ip': pubip(), 'nameservers': ' '.join(config.dns.recursiv['fil']) }
|
||||||
|
|
||||||
for line in additionnals:
|
for line in additionnals:
|
||||||
print " ", line
|
print " ", line
|
||||||
|
@ -51,7 +48,7 @@ iface %(interface)s inet static
|
||||||
netmask 255.255.248.0
|
netmask 255.255.248.0
|
||||||
broadcast 138.231.151.255
|
broadcast 138.231.151.255
|
||||||
dns-nameservers %(nameservers)s
|
dns-nameservers %(nameservers)s
|
||||||
dns-search wifi.crans.org""" % { 'interface': interface, 'ip': wifiip(), 'nameservers': nameservers }
|
dns-search wifi.crans.org""" % { 'interface': interface, 'ip': wifiip(), 'nameservers': ' '.join(config.dns.recursiv['wifi']) }
|
||||||
|
|
||||||
for line in additionnals:
|
for line in additionnals:
|
||||||
print " ", line
|
print " ", line
|
||||||
|
@ -66,7 +63,7 @@ iface %(interface)s inet static
|
||||||
broadcast 10.231.136.255
|
broadcast 10.231.136.255
|
||||||
mtu 1496
|
mtu 1496
|
||||||
dns-nameservers %(nameservers)s
|
dns-nameservers %(nameservers)s
|
||||||
dns-search adm.crans.org""" % { 'interface': interface, 'ip': admip(), 'nameservers': nameservers_adm }
|
dns-search adm.crans.org""" % { 'interface': interface, 'ip': admip(), 'nameservers': ' '.join(config.dns.recursiv['adm']) }
|
||||||
|
|
||||||
for line in additionnals:
|
for line in additionnals:
|
||||||
print " ", line
|
print " ", line
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue