The dnsZone class has attributes for some basic record types like A, SOA, etc. which are defined in the cosine schema and not in this schema. This means that your LDAP server must use both the cosine schema and this one. If you're not you should get an error from your LDAP server.
@ 3600 IN SOA ns.my-domain.com. hostmaster.my-domain.com. ( 2001030201 3600 1800 604800 86400 ) NS ns.my-domain.com. NS ns.other-domain.com. MX 10 mail.my-domain.com. MX 20 mail.other-domain.com. my-hosta A 10.10.10.10 MX 10 mail.my-domain.com. MX 20 mail.other-domain.com. www 1800 CNAME my-hosta.my-domain.com. my-hostb 3600 A 10.10.10.11 MX 10 mail.my-domain.com. MX 20 mail.other-domain.com.This can be represented by the following LDIF file:
dn: relativeDomainName=@, dc=my-domain, dc=com objectClass: dNSZone relativeDomainName: @ zoneName: my-domain.com dNSTTL: 3600 dNSClass: IN sOARecord: ns.my-domain.com. hostmaster.my-domain.com. 2001030201 3600 1800 604800 86400 nSRecord: ns.my-domain.com. nSRecord: ns.other-domain.com. mXRecord: 10 mail.my-domain.com. mXRecord: 20 mail.other-domain.com. dn: relativeDomainName=my-hosta, dc=my-domain, dc=com objectClass: dNSZone relativeDomainName: my-hosta zoneName: my-domain.com dNSTTL: 86400 dNSClass: IN aRecord: 10.10.10.10 mXRecord: 10 mail.my-domain.com. mXRecord: 20 mail.other-domain.com. dn: relativeDomainName=www, dc=my-domain, dc=com objectClass: dNSZone relativeDomainName: www zoneName: my-domain.com dNSTTL: 1800 dNSClass: IN cNAMERecord: my-hosta.my-domain.com. dn: relativeDomainName=my-hostb, dc=my-domain, dc=com objectClass: dNSZone relativeDomainName: my-hostb zoneName: my-domain.com dNSTTL: 3600 dNSClass: IN aRecord: 10.10.10.11 dn: relativeDomainName=my-hostb + dNSTTL=86400, dc=my-domain, dc=com objectClass: dNSZone relativeDomainName: my-hostb zoneName: my-domain.com dNSTTL: 86400 dNSClass: IN mXRecord: 10 mail.my-domain.com. mXRecord: 20 mail.other-domain.com.
zoneName is the name of the zone, i.e. the name of the node in the zone that is highest up in the DNS tree. relativeDomainName is the name of the nodes relative to this, just like relative names in zone files dNSClass is not used by the sdb back-end, so you can leave it out if you like. The dNSTTL can also be left out, it will then default to the TTL specified in named.conf.
If you want RRs with the same name to have different TTLs (like my-hostb in the example), you will have to store it as multiple entries all including relativeDomainName=my-hostb. You will need at least as many entries as there are different TTLs. The main difficulty is to make sure that they all have unique DNs. The way I've chosen is to have a multi-valued RDN including dNSTTL, and put all RRs with the same TTL together. This is a bit ugly, but I think this is better than having one entry per RR. Let me know if you have other ideas.
When storing multiple zones you must make sure of course that the dn's are unique. This can easily be done by including the zoneName attribute in the DN. This can be done in several ways, one example would be relativeDomainName=www, zoneName=my-zone, dc=my-domain, dc=com.
dn: relativeDomainName=hosta, dc=my-domain, dc=com objectClass: dNSZone relativeDomainName: hosta relativeDomainName: hostb relativeDomainName: hostc zoneName: my-domain.com mXRecord: 10 mail.my-domain.com. mXRecord: 20 mail.other-domain.com.
dn: relativeDomainName=www, dc=my-domain, dc=com objectClass: dNSZone relativeDomainName: www zoneName: customerdomain1.com zoneName: customerdomain2.com ... zoneName: customerdomain999.com aRecord: 10.10.10.10 mXRecord: 10 mail.my-domain.com. mXRecord: 20 mail.other-domain.com.If you have a bunch of zones that are identical, except for the zone name, you might combine all their entries like above. Sort of like using the same zone file for multiple zones.
4 PTR my-hostc.my-domain.com.Using this back-end, you change named.conf like above, and use an LDAP entry like this:
dn: relativeDomainName=4, zoneName=3.2.1.in-addr.arpa, dc=my-domain, dc=com objectClass: dNSZone relativeDomainName: 4 zoneName: 3.2.1.in-addr.arpa pTRRecord: my-hostc.my-domain.com.Note that the DN can be whatever you like. If you use a DN like the above, you can use zoneName=3.2.1.in-addr.arpa, dc=my-domain, dc=com as the search base in the URL in named.conf.