/zone2dyndb-ldif

DNS master file -> bind-dyndb-ldap convertor

Primary LanguagePython

zone2ldap

This hacky script reads DNS master file (RFC 1035 section 5) and outputs LDIF file with data suitable for bind-dyndb-ldap plugin.

Usage

zone2dyndb-ldif.py <zone file> <zone origin> <LDAP DNS base>

Example

  • Zone (master) file: /var/named/zone.example.com.db
  • Zone name (origin): zone.example.com.
  • DN of DNS container in your LDAP tree: "cn=dns, dc=ipa, dc=example, dc=com"
    • This example corresponds to FreeIPA domain "ipa.example.com."
  • Command:
    zone2dyndb-ldif.py /var/named/zone.example.com.db zone.example.com. "cn=dns, dc=ipa, dc=example, dc=com"

How to get the DN in your FreeIPA LDAP tree

  1. If needed create a kerberos ticket

    # admin can be replaced with a user of course
    kinit admin 
  2. Run a search against your ldap for the ipaDNSContainer

    ldapsearch objectClass=ipaDNSContainer dn

Depedencies

Useful links