6.3.5 DNS Host Name Resolution

The following figure shows the flow of DNS host name resolution.
Figure 6-8. DNS Resolution Sequence
Note:
  1. The host application requests to resolve hostname (for example, www.foobar.com), by calling the function gethostbyname.
  2. Before calling the gethostbyname, the application must register a DNS response callback function using the function registerSocketCallback.
  3. After the ATWINC15x0 DNS_Resolver module obtains the IP Address (hostIP) corresponding to the given HostName, the dnsResolveCB is called with the hostIP.
  4. 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.