Platform SDK: Network Management

DnsQueryConfig

The DnsQueryConfig function enables application programmers to query for the configuration of the local computer or a specific adapter.

DNS_STATUS WINAPI DnsQueryConfig(
  DNS_CONFIG_TYPE Config,
  DWORD Flag,
  PWSTR pwsAdapterName,
  PVOID pReserved,
  PVOID pBuffer,
  PDWORD pBufferLength
); 

Parameters

Config
[in] Structure specifying query requests. The following parameters can be queried:

DnsConfigPrimaryDomainName_W,

DnsConfigPrimaryDomainName_A,

DnsConfigPrimaryDomainName_UTF8,

DnsConfigAdapterDomainName_W,

DnsConfigAdapterDomainName_A,

DnsConfigAdapterDomainName_UTF8,

DnsConfigDnsServerList,

DnsConfigSearchList,

DnsConfigAdapterInfo,

DnsConfigPrimaryHostNameRegistrationEnabled,

DnsConfigAdapterHostNameRegistrationEnabled,

DnsConfigAddressRegistrationMaxCount

Flag
[in] Specifies whether the configuration should be associated with a LocalAlloc function call. Set Flag to TRUE to associate the query.
pwsAdapterName
[in] Specifies the adapter name against which the query is run.
pReserved
Reserved for future use.
pBuffer
[out] Pointer to the buffer storing the query response.
pBufferLength
[in, out] Length of the buffer, in bytes. If the buffer provided is not sufficient, an error is returned and pBufferLength contains the minimum necessary buffer size. Ignored on input if Flag is set to TRUE.

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.

See Also

DnsQuery