Platform SDK: Active Directory, ADSI, and Directory Services

DsDeregisterDnsHostRecords

The DsDeregisterDnsHostRecords function deletes domain name service (DNS) entries, except for type A records, that were registered by a domain controller. It can be executed on a domain controller other than the domain controller whose DNS entries are being removed. Only an administrator, account operator, or server operator may call this function.

This function deregisters SRV and CNAME records only. It leaves type A records intact. Deletion of site specific records (for example, _ldap._tcp._<SiteName>._sites.dc._msdcs.<DnsDomainName>) is attempted for every site (<SiteName> in this example) in the enterprise of the domain controller on which the function is executed. Therefore, this function call could create a time-consuming run and may generate significant network traffic for enterprises with many sites.

DWORD DsDeregisterDnsHostRecords(
  LPSTR ServerName,
  LPSTR DnsDomainName,
  GUID *DomainGuid,
  GUID *DsaGuid,
  LPSTR **DnsHostName
);

Parameters

ServerName
[in, optional] Specifies the name of the remote domain controller (null for local).
DnsDomainName
[in, optional] The DNS domain name of the domain occupied by the domain controller. It is unnecessary for this to be a domain hosted by this domain controller. If NULL, the DnsHostName with the leftmost label removed is specified.
*DomainGuid
[in, optional] The Domain Guid of the domain. If NULL, GUID specific names will not be removed.
*DsaGuid
[in, optional] The GUID of the NtdsDsa object that will be deleted. If NULL, NtdsDsa specific names will not be removed.
**DnsHostName
[in] The DNS host name of the domain controller whose DNS records are being deleted.

Return Values

Value Meaning
NO_ERROR Success
ERROR_ACCESS_DENIED The caller is not allowed to perform this operation.
ERROR_NOT_SUPPORTED The server specified is not a DC.

Requirements

  Windows NT/2000: Requires Windows 2000.
  Header: Declared in Dsgetdc.h.
  Library: Included as a resource in Ntdsapi.dll.
  Unicode: Implemented as Unicode and ANSI versions on Windows 2000.

See Also

DsGetDcSiteCoverage, DsGetSiteName