diff options
author | Andrew Tridgell <tridge@samba.org> | 2010-12-21 13:26:15 +1100 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2010-12-21 11:18:19 +0100 |
commit | 8466027bf91b83076b5d42b6d8cee90897930c1c (patch) | |
tree | d8ae39eaf0b4785920856b2ac44cfb15a36defc1 | |
parent | f9e2a92881c7e72d154274d75eff0ebd24316816 (diff) | |
download | samba-8466027bf91b83076b5d42b6d8cee90897930c1c.tar.gz samba-8466027bf91b83076b5d42b6d8cee90897930c1c.tar.bz2 samba-8466027bf91b83076b5d42b6d8cee90897930c1c.zip |
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
-rw-r--r-- | source4/dns_server/dlz_bind9.c | 21 |
1 files changed, 19 insertions, 2 deletions
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", |