DNS_QUERY_REQUEST3 structure (windns.h)

Contains the DNS query parameters used in a call to DnsQueryEx.

Syntax

typedef struct _DNS_QUERY_REQUEST3 {
  ULONG                         Version;
  PCWSTR                        QueryName;
  WORD                          QueryType;
  ULONG64                       QueryOptions;
  PDNS_ADDR_ARRAY               pDnsServerList;
  ULONG                         InterfaceIndex;
  PDNS_QUERY_COMPLETION_ROUTINE pQueryCompletionCallback;
  PVOID                         pQueryContext;
  BOOL                          IsNetworkQueryRequired;
  DWORD                         RequiredNetworkIndex;
  DWORD                         cCustomServers;
  DNS_CUSTOM_SERVER             *pCustomServers;
} DNS_QUERY_REQUEST3, *PDNS_QUERY_REQUEST3;

Members

Version

Type: ULONG

The structure version must be the DNS_QUERY_REQUEST_VERSION3; which has a value of 3.

QueryName

Type: PCWSTR

A pointer to a string that represents the DNS name to query.

Note

If QueryName is NULL, then the query is for the local machine name.

QueryType

Type: WORD

A value that represents the Resource Record (RR) DNS Record Type that is queried. QueryType determines the format of data pointed to by pQueryRecords returned in the DNS_QUERY_RESULT structure. For example, if the value of wType is DNS_TYPE_A, then the format of data pointed to by pQueryRecords is DNS_A_DATA.

QueryOptions

Type: ULONG64

A value that contains a bitmap of DNS Query Options to use in the DNS query. Options can be combined, and all options override DNS_QUERY_STANDARD.

pDnsServerList

Type: PDNS_ADDR_ARRAY

A pointer to a DNS_ADDR_ARRAY structure that contains a list of DNS servers to use in the query.

InterfaceIndex

Type: ULONG

A value that contains the interface index over which the query is sent. If InterfaceIndex is 0, then all interfaces will be considered.

pQueryCompletionCallback

Type: PDNS_QUERY_COMPLETION_ROUTINE

A pointer to a DNS_QUERY_COMPLETION_ROUTINE callback that is used to return the results of an asynchronous query from a call to DnsQueryEx.

Note

If NULL, then DnsQueryEx is called synchronously.

pQueryContext

Type: PVOID

A pointer to a user context.

IsNetworkQueryRequired

Type: BOOL

Reserved.

RequiredNetworkIndex

Type: DWORD

Reserved.

cCustomServers

Type: DWORD

The number of custom servers pointed to by the pCustomServers member.

pCustomServers

Type: _Field_size_(cCustomServers) DNS_CUSTOM_SERVER*

A pointer to an array of N (where N is given in the cCustomServers field) DNS_CUSTOM_SERVER objects.

If cCustomServers is 0, then pCustomServers must be NULL.

Note

At least one of pCustomServers and pDnsServerList must be NULL. Both set to non-NULL values at the same time is not supported.

Remarks

The custom servers specified in pCustomServers bypass the system-configured DNS servers.

If the query name matches a rule in the Name Resolution Policy Table (NRPT), then the custom servers are ignored, and only the servers from the NRPT rule are used.

Requirements

Requirement Value
Minimum supported client Windows Build 22000
Minimum supported server Windows Build 22000
Header windns.h

See also