DsDeregisterDnsHostRecordsA function (dsgetdc.h)
The DsDeregisterDnsHostRecords function deletes DNS entries, except for type A records registered by a domain controller. Only an administrator, account operator, or server operator may call this function.
Syntax
DSGETDCAPI DWORD DsDeregisterDnsHostRecordsA(
[in, optional] LPSTR ServerName,
[in, optional] LPSTR DnsDomainName,
[in, optional] GUID *DomainGuid,
[in, optional] GUID *DsaGuid,
[in] LPSTR DnsHostName
);
Parameters
[in, optional] ServerName
The null-terminated string that specifies the name of the remote domain controller. Can be set to NULL if the calling application is running on the domain controller being updated.
[in, optional] DnsDomainName
The null-terminated string that specifies 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.
[in, optional] DomainGuid
Pointer to the Domain GUID of the domain. If NULL, GUID specific names are not removed.
[in, optional] DsaGuid
Pointer to the GUID of the NTDS-DSA object to be deleted. If NULL, NTDS-DSA specific names are not removed.
[in] DnsHostName
Pointer to the null-terminated string that specifies the DNS host name of the domain controller whose DNS records are being deleted.
Return value
This function returns DSGETDCAPI DWORD.
Remarks
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.
Note
The dsgetdc.h header defines DsDeregisterDnsHostRecords as an alias which automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows Vista |
Minimum supported server | Windows Server 2008 |
Target Platform | Windows |
Header | dsgetdc.h |
Library | Netapi32.lib |
DLL | Netapi32.dll |