1 Reply Latest reply on Nov 10, 2019 7:46 PM by PriyaM_16

    Find IP address of website using Wiced DNS API

    AnGh_2749951

      Hello,

       

      I want to find IP address of given website, using Wiced DNS API or any other way.

      I have CYW943907AEVAL1F Evaluation Kit User Guide.

       

      Could any one please help me in this ?

        • 1. Re: Find IP address of website using Wiced DNS API
          PriyaM_16

          Please refer the httpbin_org snip for example of resolving IP address of a given host.

           

          #define SERVER_HOST        "www.httpbin.org"

          wiced_ip_address_t  ip_address;

           

          wiced_hostname_lookup( SERVER_HOST, &ip_address, DNS_TIMEOUT_MS, WICED_STA_INTERFACE );

          WPRINT_APP_INFO( ( "%s is at %u.%u.%u.%u\n", SERVER_HOST,

                                                           (uint8_t)(GET_IPV4_ADDRESS(ip_address) >> 24),

                                                           (uint8_t)(GET_IPV4_ADDRESS(ip_address) >> 16),

                                                           (uint8_t)(GET_IPV4_ADDRESS(ip_address) >> 8),

                                                           (uint8_t)(GET_IPV4_ADDRESS(ip_address) >> 0) ) );