mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Add a reverse zone with server's PTR record
Also, small cosmetic change in dns.ldif.
This commit is contained in:
parent
296ffe6c61
commit
a09d2c3498
@ -14,8 +14,8 @@ idnsName: $DOMAIN
|
||||
idnsZoneActive: TRUE
|
||||
idnsAllowDynUpdate: TRUE
|
||||
idnsUpdatePolicy: grant $REALM krb5-self * A;
|
||||
idnsSOAmName: $HOST.$DOMAIN.
|
||||
idnsSOArName: root.$HOST.$DOMAIN.
|
||||
idnsSOAmName: $FQDN.
|
||||
idnsSOArName: root.$FQDN.
|
||||
idnsSOAserial: 1
|
||||
idnsSOArefresh: 10800
|
||||
idnsSOAretry: 900
|
||||
|
24
install/share/dns_reverse.ldif
Normal file
24
install/share/dns_reverse.ldif
Normal file
@ -0,0 +1,24 @@
|
||||
dn: idnsName=$REVERSE_SUBNET.in-addr.arpa,cn=dns,$SUFFIX
|
||||
changetype: add
|
||||
objectClass: top
|
||||
objectClass: idnsZone
|
||||
objectClass: idnsRecord
|
||||
idnsName: $REVERSE_SUBNET.in-addr.arpa
|
||||
idnsZoneActive: TRUE
|
||||
idnsAllowDynUpdate: TRUE
|
||||
idnsUpdatePolicy: grant $REALM krb5-subdomain $REVERSE_SUBNET.in-addr.arpa. PTR;
|
||||
idnsSOAmName: $FQDN.
|
||||
idnsSOArName: root.$FQDN.
|
||||
idnsSOAserial: 1
|
||||
idnsSOArefresh: 10800
|
||||
idnsSOAretry: 900
|
||||
idnsSOAexpire: 604800
|
||||
idnsSOAminimum: 86400
|
||||
NSRecord: $FQDN.
|
||||
|
||||
dn: idnsName=$REVERSE_HOST,idnsName=$REVERSE_SUBNET.in-addr.arpa,cn=dns,$SUFFIX
|
||||
changetype: add
|
||||
objectClass: idnsRecord
|
||||
objectClass: top
|
||||
idnsName: $REVERSE_HOST
|
||||
PTRRecord: $FQDN.
|
@ -71,6 +71,12 @@ class BindInstance(service.Service):
|
||||
self.host = fqdn.split(".")[0]
|
||||
self.suffix = util.realm_to_suffix(self.realm)
|
||||
|
||||
tmp = ip_address.split(".")
|
||||
tmp.reverse()
|
||||
|
||||
self.reverse_host = tmp.pop(0)
|
||||
self.reverse_subnet = ".".join(tmp)
|
||||
|
||||
self.__setup_sub_dict()
|
||||
|
||||
def create_sample_bind_zone(self):
|
||||
@ -90,15 +96,16 @@ class BindInstance(service.Service):
|
||||
# FIXME: this need to be split off, as only the first server can do
|
||||
# this operation
|
||||
self.step("Setting up our zone", self.__setup_zone)
|
||||
self.step("setting up reverse zone", self.__setup_reverse_zone)
|
||||
|
||||
self.step("Setting up kerberos principal", self.__setup_principal)
|
||||
self.step("Setting up named.conf", self.__setup_named_conf)
|
||||
self.step("setting up kerberos principal", self.__setup_principal)
|
||||
self.step("setting up named.conf", self.__setup_named_conf)
|
||||
|
||||
self.step("restarting named", self.__start)
|
||||
self.step("configuring named to start on boot", self.__enable)
|
||||
|
||||
self.step("Changing resolv.conf to point to ourselves", self.__setup_resolv_conf)
|
||||
self.start_creation("Configuring bind:")
|
||||
self.step("changing resolv.conf to point to ourselves", self.__setup_resolv_conf)
|
||||
self.start_creation("Configuring named:")
|
||||
|
||||
def __start(self):
|
||||
try:
|
||||
@ -117,12 +124,17 @@ class BindInstance(service.Service):
|
||||
DOMAIN=self.domain,
|
||||
HOST=self.host,
|
||||
REALM=self.realm,
|
||||
SUFFIX=self.suffix)
|
||||
SUFFIX=self.suffix,
|
||||
REVERSE_HOST=self.reverse_host,
|
||||
REVERSE_SUBNET=self.reverse_subnet)
|
||||
|
||||
def __setup_zone(self):
|
||||
self.backup_state("domain", self.domain)
|
||||
self._ldap_mod("dns.ldif", self.sub_dict)
|
||||
|
||||
def __setup_reverse_zone(self):
|
||||
self._ldap_mod("dns_reverse.ldif", self.sub_dict)
|
||||
|
||||
def __setup_principal(self):
|
||||
dns_principal = "DNS/" + self.fqdn + "@" + self.realm
|
||||
installutils.kadmin_addprinc(dns_principal)
|
||||
|
Loading…
Reference in New Issue
Block a user