DnsApi simple exploration (2) DNS

Source: Internet
Author: User
As mentioned above, the DnsQueryEx () request requires three parameters. DNS_QUERY_REQUEST is the first parameter used for request information, such as the DNS server to be requested and the domain name to be requested. the DNS_QUERY_REQUESTstructureDNS_QUERY_REQUEST structure contains the parameter language used by DnsQueryEx () for DNS requests.

As mentioned above, the DnsQueryEx () request requires three parameters. DNS_QUERY_REQUEST is the first parameter used for request information, such as the DNS server to be requested and the domain name to be requested. DNS_QUERY_REQUEST structure the DNS_QUERY_REQUEST structure contains the parameter language used by DnsQueryEx () for DNS requests.

As mentioned above, the DnsQueryEx () request requires three parameters. DNS_QUERY_REQUEST is the first parameter used for request information, such as the DNS server to be requested and the domain name to be requested.


DNS_QUERY_REQUEST structure

The DNS_QUERY_REQUEST structure contains the parameters used by DnsQueryEx () for DNS requests.

Syntax

typedef struct _DNS_QUERY_REQUEST {       ULONG                         Version;       PCWSTR                        QueryName;       WORD                          QueryType;       ULONG64                       QueryOptions;       PDNS_ADDR_ARRAY               pDnsServerList;       ULONG                         InterfaceIndex;       PDNS_QUERY_COMPLETION_ROUTINE pQueryCompletionCallback;       PVOID                         pQueryContext;} DNS_QUERY_REQUEST, *PDNS_QUERY_REQUEST;


Member

Version

The structure version number must be one of the following:

DNS_QUERY_REQUEST_VERSION1(1)

QueryName

A pointer to the string of the DNS name to be queried,

Note:IfQueryNameIf it is null, use the local DNS for query.

QueryType

Resource Record (RR)DNS_Record_TypeIndicates whether the request is sent.

QueryTypeDecidedDNS_QUERY_RESULTReturnedPQueryRecordData format.

For example, ifWTypeYesDNS_TYPE_A,PQueryRecordsThe data format isDNS_A_DATA.

QueryOptions

ContainsDNS_Query_OptionsBitmap ).

DNS_Query_OptionsOptions can be combined, and all options OverwriteDNS_QUERY_STANDARD

PDnsServerList

One pointDNS_ADDR_ARRAYContainsDNS_ServersList.

InterfaceIndex

Interface index. If the InterfaceIndex value is 0, all interfaces will be considered.

PQueryCompletionCallback

PointDNS_QUERY_COMPLETION_ROUTINEPointer to the callback function,DNS_QUERY_COMPLETION_ROUTINEReturns the asynchronous query result.

Note:If the value isNULL, DnsQueryEx isSynchronizationMechanism.

PQueryContext

Pointer to user-defined data.


Note:

Some definitions, suchQueryTypeAnd so on,Please refer to the official website of Microsoft.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.