Samba4 and BIND9_DLZ – static records with samba_dnsupdate dynamic dlz

binddomain-name-systemdynamic-dnssamba4

I have some records in bind for my DNS zone.
Now I want to configure Samba4 Active Directory which wants to add some dynamic records into my zone. So I include /var/lib/samba/private/named.conf in my /etc/bind/named.conf. Problem is that same zone is defined statically and dynamically. It leads to error:

named[8992]: generating session key for dynamic DNS
named[8992]: sizing zone task pool based on 24 zones
named[8992]: Loading 'AD DNS Zone' using driver dlopen
named[8992]: samba_dlz: started for DN DC=myzone,DC=cz
named[8992]: samba_dlz: starting configure
named[8992]: samba_dlz: Failed to configure zone 'myzone.cz'
named[8992]: loading configuration: already exists
named[8992]: exiting (due to fatal error)
named[8992]: samba_dlz: shutting down

named.conf:

view "internal" {
  zone "myzone.cz" {
              type master;
              file "/etc/bind/zones/internal/myzone.cz.db";
  };
  include "/var/lib/samba/private/named.conf";
}

/var/lib/samba/private/named.conf:

dlz "AD DNS Zone" {
    # For BIND 9.9.0
        database "dlopen /usr/lib/x86_64-linux-gnu/samba/bind9/dlz_bind9_9.so";
};

How should I configure that to have static and Samba-dynamic DNS records? Thanks.

Best Answer

My solution was to simply remove the bind 'zone' entry and let samba have control. I assume they would be conflicting anyway. If you look on the samba docs site.. https://wiki.samba.org/index.php/Setup_a_basic_BIND_installation

You will see that they leave out any extra zones other than the 'localhost' ones.