6.3.5 DNS Host Name Resolution
The following figure shows the flow of DNS host name resolution.
Note:
- The host application requests to resolve hostname (for example, www.foobar.com), by calling the function
gethostbyname
. - Before calling the
gethostbyname
, the application must register a DNS response callback function using the functionregisterSocketCallback
. - After the
ATWINC15x0 DNS_Resolver module
obtains the IP Address (hostIP) corresponding to the given HostName, the
dnsResolveCB
is called with the hostIP. - If an error occurs or if the
DNS request encounters a time-out, the
dnsResolveCB
is called with IP Address value zero indicating a failure to resolve the domain name.