smb.conf: add dns_zone_scavenging
authorGary Lockyer <gary@catalyst.net.nz>
Wed, 11 Jul 2018 04:30:38 +0000 (16:30 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 12 Jul 2018 02:31:51 +0000 (04:31 +0200)
Add parameter dns_zone_scavenging to control dns zone scavenging.
Scavenging is disabled by default, as due to
https://bugzilla.samba.org/show_bug.cgi?id=12451 the ageing properties of
existing DNS entries are incorrect.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
docs-xml/smbdotconf/domain/dnszonescavenging.xml [new file with mode: 0644]
lib/param/loadparm.c
source3/param/loadparm.c

diff --git a/docs-xml/smbdotconf/domain/dnszonescavenging.xml b/docs-xml/smbdotconf/domain/dnszonescavenging.xml
new file mode 100644 (file)
index 0000000..80ec144
--- /dev/null
@@ -0,0 +1,23 @@
+<samba:parameter name="dns zone scavenging"
+                 context="G"
+                 type="boolean"
+                 xmlns:samba="http://www.samba.org/samba/DTD/samba-doc">
+<description>
+       <para>
+       When enabled (the default is disabled) unused dynamic dns records are
+       periodically removed.
+       </para>
+       <warning><para>
+       This option should not be enabled for installations created with
+       versions of samba before 4.9. Doing this will result in the loss of
+       static DNS entries. This is due to a bug in previous versions
+       of samba (BUG 12451) which marked dynamic DNS records as static and
+       static records as dynamic.
+       </para></warning>
+       <note><para>
+       If one record for a DNS name is static (non-aging) then no other record
+       for that DNS name will be scavenged.
+       </para></note>
+</description>
+<value type="default">no</value>
+</samba:parameter>
index 75ee6685b7208a3c0866af5c80f84bc4ccded713..1debcfff12788889771d3445fc40f0889e52d9b2 100644 (file)
@@ -2778,6 +2778,7 @@ struct loadparm_context *loadparm_init(TALLOC_CTX *mem_ctx)
        lpcfg_do_global_parameter(lp_ctx, "nsupdate command", "/usr/bin/nsupdate -g");
 
         lpcfg_do_global_parameter(lp_ctx, "allow dns updates", "secure only");
+       lpcfg_do_global_parameter(lp_ctx, "dns zone scavenging", "False");
         lpcfg_do_global_parameter(lp_ctx, "dns forwarder", "");
 
        lpcfg_do_global_parameter(lp_ctx, "algorithmic rid base", "1000");
index 5f646d63ce0db8012c8c0c86d3b4b41e9552d186..291ba57e0bb2a84be441813e503a77b7cdd3c936 100644 (file)
@@ -895,6 +895,7 @@ static void init_globals(struct loadparm_context *lp_ctx, bool reinit_globals)
        Globals._preferred_master = Auto;
 
        Globals.allow_dns_updates = DNS_UPDATE_SIGNED;
+       Globals.dns_zone_scavenging = false;
 
        lpcfg_string_set(Globals.ctx, &Globals.ntp_signd_socket_directory,
                         get_dyn_NTP_SIGND_SOCKET_DIR());