Platform SDK: Network Management

DnsModifyRecordsInSet

The DnsModifyRecordsInSet function alters an existing resource record set that was previously registered with DNS servers. Like many DNS functions, the DnsModifyRecordsInSet function type is implemented in multiple forms to facilitate different character encoding. Based on the character encoding involved, use one of the following functions:

DnsModifyRecordsInSet_A (_A for ANSI encoding)

DnsModifyRecordsInSet_W (_W for Unicode encoding)

DnsModifyRecordsInSet_UTF8 (_UTF8 for UTF 8 encoding)

If the DnsModifyRecordsInSet function type is called without its suffix (_A, _W, or _UTF8), a compiler error will occur.

DNS_STATUS WINAPI DnsModifyRecordsInSet(
  PDNS_RECORD pAddRecords,
  PDNS_RECORD pDeleteRecords,
  DWORD Options,
  HANDLE hContext, 
  PIP_ARRAY pServerList, 
  PVOID pReserved
); 

Parameters

pAddRecords
[in] Pointer to the DNS_RECORD structure containing the resource records to be added to the resource record set.
pDeleteRecords
[in] Pointer to the DNS_RECORD structure containing the resource records to be deleted from the resource record set.
Options
[in] Options to apply to the operation. Options consist of the following, and may be combined.
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.

hContextHandle
[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.

Remarks

The DnsModifyRecordsInSet function type executes in the following steps.

  1. Records specified in pDeleteRecords are deleted. If pDeleteRecords is empty or doesn't contain records that exist in the current set, the DnsModifyRecordInSet function goes to the next step.
  2. Records specified in pAddRecords are added. If pAddRecords is empty, the operation completes without adding any records.

Return Values

Returns success confirmation upon successful completion. Otherwise, it 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.

See Also

DnsReplaceRecordSet, DnsQuery