TCPIP_DNS_Resolve Function

C

TCPIP_DNS_RESULT TCPIP_DNS_Resolve(
    const char* hostName, 
    TCPIP_DNS_RESOLVE_TYPE type
);

Description

This function attempts to resolve a host name to an IP address. When called, it will attempt to send a DNS query to a DNS server for resolving the name. Call TCPIP_DNS_IsResolved to determine if name resolution is complete.

Preconditions

DNS client module initialized.

Parameters

ParametersDescription
hostNameA pointer to the null terminated string specifying the host for which to resolve an IP.
typeA TCPIP_DNS_RESOLVE_TYPE value specifying the desired resolution.

Returns

  • TCPIP_DNS_RES_OK - Success, name is solved.

  • TCPIP_DNS_RES_PENDING - Operation is ongoing.

  • TCPIP_DNS_RES_NAME_IS_IPADDRESS - Name request is a IPv4 or IPv6 address.

  • An error code if an error occurred.

Remarks

To clear the cache use TCPIP_DNS_Disable(hNet, true);