Export (0) Print
Expand All

DnsQueryConfig function

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

Syntax


DNS_STATUS WINAPI DnsQueryConfig(
  _In_      DNS_CONFIG_TYPE Config,
  _In_      DWORD Flag,
  _In_opt_  PCWSTR pwsAdapterName,
  _In_opt_  PVOID pReserved,
  _Out_     PVOID pBuffer,
  _Inout_   PDWORD pBufferLength
);

Parameters

Config [in]

A DNS_CONFIG_TYPE value that specifies the configuration type of the information to be queried.

Flag [in]

A value that specifies whether to allocate memory for the configuration information. Set Flag to DNS_CONFIG_FLAG_ALLOC to allocate memory; otherwise, set it to 0.

Note  Free the allocated memory with LocalFree.

pwsAdapterName [in, optional]

A pointer to a string that represents the adapter name against which the query is run.

pReserved [in, optional]

Reserved for future use.

pBuffer [out]

A pointer to a buffer that receives the query response. The following table shows the data type of the buffer for each of the Config parameter values.

Config parameterData type of buffer
DnsConfigPrimaryDomainName_WPWCHAR
DnsConfigPrimaryDomainName_APCHAR
DnsConfigPrimaryDomainName_UTF8PCHAR
DnsConfigAdapterDomainName_WNot implemented
DnsConfigAdapterDomainName_ANot implemented
DnsConfigAdapterDomainName_UTF8Not implemented
DnsConfigDnsServerListIP4_ARRAY
DnsConfigSearchListNot implemented
DnsConfigAdapterInfoNot implemented
DnsConfigPrimaryHostNameRegistrationEnabledDWORD
DnsConfigAdapterHostNameRegistrationEnabledDWORD
DnsConfigAddressRegistrationMaxCountDWORD
DnsConfigHostName_WPWCHAR
DnsConfigHostName_APCHAR
DnsConfigHostName_UTF8PCHAR
DnsConfigFullHostName_WPWCHAR
DnsConfigFullHostName_APCHAR
DnsConfigFullHostName_UTF8PCHAR

 

pBufferLength [in, out]

The 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 value

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

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Windns.h

Library

Dnsapi.lib

DLL

Dnsapi.dll

See also

DnsQuery
DNS_CONFIG_TYPE
DNS_RECORD

 

 

Community Additions

ADD
Show:
© 2014 Microsoft