Platform SDK: Network Management

DnsReplaceRecordSet

The DnsReplaceRecordSet function type replaces an existing record set. Like many DNS functions, the DnsReplaceRecordSet function type is implemented in multiple forms to facilitate different character encoding, which is indicated by a suffix. Based on the character encoding involved, use one of the following functions:

DnsReplaceRecordSetA (_A for ANSI encoding)

DnsReplaceRecordSetW (_W for Unicode encoding)

DnsReplaceRecordSetUTF8 (_UTF8 for UTF 8 encoding)

Notice the lack of an underscore between the function type name and its suffix. If the DnsModifyRecordsInSet function type is called without its suffix (A, W, or UTF8), a compiler error will occur.

DNS_STATUS WINAPI DnsReplaceRecordSet (
  PDNS_RECORD pNewSet,
  DWORD Options,
  HANDLE hContext,       
  PIP_ARRAY pServerList,   
  PVOID pReserved
); 

Parameters

pNewSet
[in] Pointer to the DNS_RECORD structure holding the resource record set that replaces the existing set. The specified resource record set is replaced with the contents of pNewSet. To delete a resource record set, specify the set in pNewSet but set RDATA to NULL.
Options
[in] Options available for the function call, which may be combined, are shown in the following table.
Option Meaning
DNS_UPDATE_SECURITY_USE_DEFAULT Uses the default behavior, which is specified in the registry, for secure dynamic DNS updates.
DNS_UPDATE_SECURITY_OFF Does not attempt secure dynamic updates.
DNS_UPDATE_SECURITY_ON Attempts nonsecure dynamic update. If refused, then attempts secure dynamic update.
DNS_UPDATE_SECURITY_ONLY Attempts secure dynamic updates only.
DNS_UPDATE_CACHE_SECURITY_CONTEXT Caches the security context for use in future transactions.
DNS_UPDATE_TEST_USE_LOCAL_SYS_ACCT Uses credentials of the local computer account.
DNS_UPDATE_FORCE_SECURITY_NEGO Does not use cached security context.
DNS_UPDATE_RESERVED Reserved for future use.

hContext
[in] Handle to the credentials of a specific account. Used when secure dynamic update is required. This parameter is optional.
pServerList
[in] Array of DNS server IP addresses to which the Find Authoritative Zone (FAZ) request is sent.
pReserved
Reserved for future use.

Return Values

Returns success confirmation upon successful completion. Otherwise, returns the appropriate DNS-specific error code as defined in Winerror.h.

Requirements

  Windows NT/2000: Requires Windows 2000.
  Header: Declared in Windns.h.
  Library: Use Dnsapi.lib.