From 8466027bf91b83076b5d42b6d8cee90897930c1c Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 21 Dec 2010 13:26:15 +1100 Subject: s4-dns: return the local hostname as the SOA authority this is done by all DCs in the domain to ensure that updates go to the right place --- source4/dns_server/dlz_bind9.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'source4') diff --git a/source4/dns_server/dlz_bind9.c b/source4/dns_server/dlz_bind9.c index 931f2f30b6..3c8107a3f2 100644 --- a/source4/dns_server/dlz_bind9.c +++ b/source4/dns_server/dlz_bind9.c @@ -144,10 +144,26 @@ static bool b9_format(struct dlz_bind9_data *state, *data = rec->data.ns; break; - case DNS_TYPE_SOA: + case DNS_TYPE_SOA: { + const char *mname; *type = "soa"; + + /* we need to fake the authoritative nameserver to + * point at ourselves. This is now 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) { + return false; + } + mname = strlower_talloc(mem_ctx, mname); + if (mname == NULL) { + return false; + } + *data = talloc_asprintf(mem_ctx, "%s %s %u %u %u %u %u", - rec->data.soa.mname, + mname, rec->data.soa.rname, rec->data.soa.serial, rec->data.soa.refresh, @@ -155,6 +171,7 @@ static bool b9_format(struct dlz_bind9_data *state, rec->data.soa.expire, rec->data.soa.minimum); break; + } default: state->log(ISC_LOG_ERROR, "samba b9_putrr: unhandled record type %u", -- cgit