univention.admin.handlers.dns package

UDM module for DNS records

univention.admin.handlers.dns.makeContactPerson(obj, arg)[source]

Create contact Email-address for domain.

univention.admin.handlers.dns.unescapeSOAemail(email)[source]

Un-escape Email-address from DNS SOA record. >>> unescapeSOAemail(r’first.last.domain.tld’) ‘first.last@domain.tld

univention.admin.handlers.dns.escapeSOAemail(email)[source]

Escape Email-address for DNS SOA record. >>> escapeSOAemail(‘first.last@domain.tld’) ‘first\.last.domain.tld’

univention.admin.handlers.dns.stripDot(old, encoding=())[source]
>>> stripDot(['example.com.', 'example.com'])
['example.com', 'example.com']
>>> stripDot('example.com.')
'example.com'
>>> stripDot([])
[]
>>> stripDot('')
''
>>> stripDot(None)

Submodules

univention.admin.handlers.dns.alias module

UDM module for DNS aliases (CNAME)

class univention.admin.handlers.dns.alias.object(co, lo, position, dn='', superordinate=None, attributes=[], update_zone=True)[source]

Bases: univention.admin.handlers.simpleLdap

module = 'dns/alias'
classmethod unmapped_lookup_filter()[source]

Return a LDAP filter UDM filter expression.

Returns

A LDAP filter expression.

Return type

univention.admin.filter.conjunction

See lookup_filter().

classmethod lookup_filter_superordinate(filter, superordinate)[source]
univention.admin.handlers.dns.alias.identify(dn, attr, canonical=False)[source]
univention.admin.handlers.dns.alias.lookup_alias_filter(lo, filter_s)[source]

univention.admin.handlers.dns.dns module

UDM module for all DNS objects

class univention.admin.handlers.dns.dns.object(co, lo, position, dn='', superordinate=None, attributes=None)[source]

Bases: univention.admin.handlers.simpleLdap

module = 'dns/dns'
univention.admin.handlers.dns.dns.rewrite(filter_s, **args)[source]
univention.admin.handlers.dns.dns.lookup(co, lo, filter_s, base='', superordinate=None, scope='sub', unique=False, required=False, timeout=- 1, sizelimit=0)[source]
univention.admin.handlers.dns.dns.identify(dn, attr, canonical=False)[source]

univention.admin.handlers.dns.forward_zone module

UDM module for DNS forward zones

univention.admin.handlers.dns.forward_zone.mapMX(old, encoding=())[source]
univention.admin.handlers.dns.forward_zone.unmapMX(old, encoding=())[source]
class univention.admin.handlers.dns.forward_zone.object(co, lo, position, dn='', superordinate=None, attributes=[])[source]

Bases: univention.admin.handlers.simpleLdap

module = 'dns/forward_zone'
open()[source]

Opens this object.

During the initialization of this object the current set LDAP attributes are mapped into info. This method makes it possible to e.g. resolve external references to other objects which are not represented in the raw LDAP attributes of this object, for example the group memberships of a user.

By default only the open hook for extended attributes is called. This method can be subclassed.

Warning

If this method changes anything in self.info it must call save() afterwards.

Warning

If your are going to do any modifications (such as creating, modifying, moving, removing this object) this method must be called directly after the constructor and before modifying any property.

classmethod unmapped_lookup_filter()[source]

Return a LDAP filter UDM filter expression.

Returns

A LDAP filter expression.

Return type

univention.admin.filter.conjunction

See lookup_filter().

univention.admin.handlers.dns.forward_zone.identify(dn, attr, canonical=False)[source]

univention.admin.handlers.dns.host_record module

UDM module for DNS host records

univention.admin.handlers.dns.host_record.unmapMX(old, encoding=())[source]
univention.admin.handlers.dns.host_record.mapMX(old, encoding=())[source]
univention.admin.handlers.dns.host_record.unmapIPAddresses(values, encoding=())[source]
class univention.admin.handlers.dns.host_record.object(co, lo, position, dn='', superordinate=None, attributes=[], update_zone=True)[source]

Bases: univention.admin.handlers.simpleLdap

module = 'dns/host_record'
classmethod unmapped_lookup_filter()[source]

Return a LDAP filter UDM filter expression.

Returns

A LDAP filter expression.

Return type

univention.admin.filter.conjunction

See lookup_filter().

classmethod lookup_filter_superordinate(filter, superordinate)[source]
classmethod rewrite_filter(filter, mapping)[source]
univention.admin.handlers.dns.host_record.identify(dn, attr, canonical=False)[source]

univention.admin.handlers.dns.ns_record module

UDM module for DNS Name Server records

class univention.admin.handlers.dns.ns_record.object(co, lo, position, dn='', superordinate=None, attributes=[], update_zone=True)[source]

Bases: univention.admin.handlers.simpleLdap

module = 'dns/ns_record'
univention.admin.handlers.dns.ns_record.lookup_filter(filter_s=None, superordinate=None)[source]
univention.admin.handlers.dns.ns_record.lookup(co, lo, filter_s, base='', superordinate=None, scope='sub', unique=False, required=False, timeout=- 1, sizelimit=0, serverctrls=None, response=None)[source]
univention.admin.handlers.dns.ns_record.identify(dn, attr, canonical=False)[source]

univention.admin.handlers.dns.ptr_record module

UDM module for DNS reverse pointer records (PTR)

univention.admin.handlers.dns.ptr_record.ipv6(string)[source]
>>> ipv6('0123456789abcdef0123456789abcdef')
'0123:4567:89ab:cdef:0123:4567:89ab:cdef'
univention.admin.handlers.dns.ptr_record.calc_ip(rev, subnet)[source]
>>> calc_ip(rev='8.0.0.0.7.0.0.0.6.0.0.0.5.0.0.0.4.0.0', subnet='0001:0002:0003:0').exploded
'0001:0002:0003:0004:0005:0006:0007:0008'
>>> calc_ip(rev='4.3', subnet='1.2').exploded
'1.2.3.4'
univention.admin.handlers.dns.ptr_record.calc_rev(ip, subnet)[source]
>>> calc_rev(ip='1.2.3.4', subnet='1.2')
'4.3'
>>> calc_rev(ip='0001:0002:0003:0004:0005:0006:0007:0008', subnet='0001:0002:0003:0')
'8.0.0.0.7.0.0.0.6.0.0.0.5.0.0.0.4.0.0'
>>> calc_rev(ip='1:2:3:4:5:6:7:8', subnet='0001:0002:0003:0')
'8.0.0.0.7.0.0.0.6.0.0.0.5.0.0.0.4.0.0'
class univention.admin.handlers.dns.ptr_record.object(co, lo, position, dn='', superordinate=None, attributes=[], update_zone=True)[source]

Bases: univention.admin.handlers.simpleLdap

module = 'dns/ptr_record'
description()[source]

Return a descriptive string for the object. By default the relative distinguished name is returned.

Returns

A descriptive string or none if no dn is not yet set.

Return type

str

open()[source]

Opens this object.

During the initialization of this object the current set LDAP attributes are mapped into info. This method makes it possible to e.g. resolve external references to other objects which are not represented in the raw LDAP attributes of this object, for example the group memberships of a user.

By default only the open hook for extended attributes is called. This method can be subclassed.

Warning

If this method changes anything in self.info it must call save() afterwards.

Warning

If your are going to do any modifications (such as creating, modifying, moving, removing this object) this method must be called directly after the constructor and before modifying any property.

ready()[source]

Makes sure all preconditions are met before creating or modifying this object.

It checks if all properties marked required are set. It checks if the superordinate is valid.

Returns

True

Return type

bool

Raises

univention.admin.uexceptions.insufficientInformation

classmethod lookup_filter_superordinate(filter, superordinate)[source]
classmethod unmapped_lookup_filter()[source]

Return a LDAP filter UDM filter expression.

Returns

A LDAP filter expression.

Return type

univention.admin.filter.conjunction

See lookup_filter().

univention.admin.handlers.dns.ptr_record.rewrite_rev(filter, subnet)[source]

Rewrite LDAP filter expression and convert (ip) -> (zone,reversed)

>>> rewrite_rev(expression('ip', '1.2.3.4'), subnet='1.2')
conjunction('&', [expression('zoneName', '2.1.in-addr.arpa', '='), expression('relativeDomainName', '4.3', '=')])
>>> rewrite_rev(expression('ip', '1.2.3.*', escape=False), subnet='1.2')
conjunction('&', [expression('zoneName', '2.1.in-addr.arpa', '='), expression('relativeDomainName', '*.3', '=')])
>>> rewrite_rev(expression('ip', '1.2.*.*', escape=False), subnet='1.2')
conjunction('&', [expression('zoneName', '2.1.in-addr.arpa', '='), expression('relativeDomainName', '*.*', '=')])
>>> rewrite_rev(expression('ip', '1.2.*.4', escape=False), subnet='1.2')
conjunction('&', [expression('zoneName', '2.1.in-addr.arpa', '='), expression('relativeDomainName', '4.*', '=')])
>>> rewrite_rev(expression('ip', '1.2.*', escape=False), subnet='1.2')
conjunction('&', [expression('zoneName', '2.1.in-addr.arpa', '='), expression('relativeDomainName', '*', '=')])
>>> rewrite_rev(expression('ip', '1:2:3:4:5:6:7:8'), subnet='0001:0002')
conjunction('&', [expression('zoneName', '2.0.0.0.1.0.0.0.ip6.arpa', '='), expression('relativeDomainName', '8.0.0.0.7.0.0.0.6.0.0.0.5.0.0.0.4.0.0.0.3.0.0.0', '=')])
>>> rewrite_rev(expression('ip', '1:2:3:4:5:6:7:*', escape=False), subnet='0001:0002')
conjunction('&', [expression('zoneName', '2.0.0.0.1.0.0.0.ip6.arpa', '='), expression('relativeDomainName', '*.7.0.0.0.6.0.0.0.5.0.0.0.4.0.0.0.3.0.0.0', '=')])
>>> rewrite_rev(expression('ip', '1:2:3:4:5:6:*:8', escape=False), subnet='0001:0002')
conjunction('&', [expression('zoneName', '2.0.0.0.1.0.0.0.ip6.arpa', '='), expression('relativeDomainName', '8.0.0.0.*.6.0.0.0.5.0.0.0.4.0.0.0.3.0.0.0', '=')])
>>> rewrite_rev(expression('ip', '1:2:3:*', escape=False), subnet='0001:0002')
conjunction('&', [expression('zoneName', '2.0.0.0.1.0.0.0.ip6.arpa', '='), expression('relativeDomainName', '*.3.0.0.0', '=')])
univention.admin.handlers.dns.ptr_record.identify(dn, attr)[source]

univention.admin.handlers.dns.reverse_zone module

UDM module for DNS reverse zones

univention.admin.handlers.dns.reverse_zone.mapSubnet(subnet, encoding=())[source]

Map subnet to reverse zone. >>> mapSubnet(‘0123:4567:89ab:cdef’) ‘f.e.d.c.b.a.9.8.7.6.5.4.3.2.1.0.ip6.arpa’ >>> mapSubnet(‘0123:4567:89ab:cd’) ‘d.c.b.a.9.8.7.6.5.4.3.2.1.0.ip6.arpa’ >>> mapSubnet(‘1.2.3’) ‘3.2.1.in-addr.arpa’

univention.admin.handlers.dns.reverse_zone.unmapSubnet(zone, encoding=())[source]

Map reverse zone to subnet. >>> unmapSubnet([b’f.e.d.c.b.a.9.8.7.6.5.4.3.2.1.0.ip6.arpa’]) ‘0123:4567:89ab:cdef’ >>> unmapSubnet([b’d.c.b.a.9.8.7.6.5.4.3.2.1.0.ip6.arpa’]) ‘0123:4567:89ab:cd’ >>> unmapSubnet([b’3.2.1.in-addr.arpa’]) ‘1.2.3’

class univention.admin.handlers.dns.reverse_zone.object(co, lo, position, dn='', superordinate=None, attributes=[])[source]

Bases: univention.admin.handlers.simpleLdap

module = 'dns/reverse_zone'
open()[source]

Opens this object.

During the initialization of this object the current set LDAP attributes are mapped into info. This method makes it possible to e.g. resolve external references to other objects which are not represented in the raw LDAP attributes of this object, for example the group memberships of a user.

By default only the open hook for extended attributes is called. This method can be subclassed.

Warning

If this method changes anything in self.info it must call save() afterwards.

Warning

If your are going to do any modifications (such as creating, modifying, moving, removing this object) this method must be called directly after the constructor and before modifying any property.

description()[source]

Return a descriptive string for the object. By default the relative distinguished name is returned.

Returns

A descriptive string or none if no dn is not yet set.

Return type

str

classmethod unmapped_lookup_filter()[source]

Return a LDAP filter UDM filter expression.

Returns

A LDAP filter expression.

Return type

univention.admin.filter.conjunction

See lookup_filter().

univention.admin.handlers.dns.reverse_zone.identify(dn, attr)[source]

univention.admin.handlers.dns.srv_record module

UDM module for DNS service records (SRV)

univention.admin.handlers.dns.srv_record.unmapName(old, encoding=())[source]
univention.admin.handlers.dns.srv_record.mapName(old, encoding=())[source]
univention.admin.handlers.dns.srv_record.unmapLocation(old, encoding=())[source]
univention.admin.handlers.dns.srv_record.mapLocation(old, encoding=())[source]
class univention.admin.handlers.dns.srv_record.object(co, lo, position, dn='', superordinate=None, attributes=[], update_zone=True)[source]

Bases: univention.admin.handlers.simpleLdap

module = 'dns/srv_record'
classmethod unmapped_lookup_filter()[source]

Return a LDAP filter UDM filter expression.

Returns

A LDAP filter expression.

Return type

univention.admin.filter.conjunction

See lookup_filter().

classmethod lookup_filter_superordinate(filter, superordinate)[source]
univention.admin.handlers.dns.srv_record.identify(dn, attr, canonical=False)[source]

univention.admin.handlers.dns.txt_record module

UDM module for DNS text records (TXT)

class univention.admin.handlers.dns.txt_record.object(co, lo, position, dn='', superordinate=None, attributes=[], update_zone=True)[source]

Bases: univention.admin.handlers.simpleLdap

module = 'dns/txt_record'
classmethod unmapped_lookup_filter()[source]

Return a LDAP filter UDM filter expression.

Returns

A LDAP filter expression.

Return type

univention.admin.filter.conjunction

See lookup_filter().

classmethod lookup_filter_superordinate(filter, superordinate)[source]
univention.admin.handlers.dns.txt_record.identify(dn, attr, canonical=False)[source]