]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s4:dns_server: Use lpcfg_dns_hostname() in dlz_bind9.c
authorAndreas Schneider <asn@samba.org>
Thu, 4 Apr 2024 09:28:39 +0000 (11:28 +0200)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 22 May 2024 20:33:36 +0000 (20:33 +0000)
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source4/dns_server/dlz_bind9.c

index 409e2f30dff25596e4617be80e84cc9cd89f2e99..02de7dae796b1dd0f6c693e67e1213dd9f121fd2 100644 (file)
@@ -240,6 +240,7 @@ static bool b9_format(struct dlz_bind9_data *state,
                break;
 
        case DNS_TYPE_SOA: {
+               const char *dns_hostname = NULL;
                const char *mname;
                *type = "soa";
 
@@ -247,13 +248,11 @@ static bool b9_format(struct dlz_bind9_data *state,
                 * point at ourselves. This is how AD DNS servers
                 * force clients to send updates to the right local DC
                 */
-               mname = talloc_asprintf(mem_ctx, "%s.%s.",
-                                       lpcfg_netbios_name(state->lp),
-                                       lpcfg_dnsdomain(state->lp));
-               if (mname == NULL) {
+               dns_hostname = lpcfg_dns_hostname(state->lp);
+               if (dns_hostname == NULL) {
                        return false;
                }
-               mname = strlower_talloc(mem_ctx, mname);
+               mname = talloc_asprintf(mem_ctx, "%s.", dns_hostname);
                if (mname == NULL) {
                        return false;
                }