This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC3301: LWiP dns_gethostbyname not working

Part Number: CC3301

Hi 

I am trying to make an application with the new CC3301 and I have alot of things working. 

Device is connected to AP and IP address is obtained.

But now i am a bit stuck trying to resolve an IP address from a hostname using the LWiP  dns_gethostbyname(...) method.



This is the linie where i am calling the lookup: 

uint32_t RetVal = dns_gethostbyname("www.example.com", &TargetIp, dnsFound, NULL);


The callback is never called
and when I trace down - I get to this section below in the dns.c file


for (i = 0; i < DNS_TABLE_SIZE; ++i) {
if ((dns_table[i].state == DNS_STATE_DONE) &&
(lwip_strnicmp(name, dns_table[i].name, sizeof(dns_table[i].name)) == 0) &&
LWIP_DNS_ADDRTYPE_MATCH_IP(dns_addrtype, dns_table[i].ipaddr)) {
LWIP_DEBUGF(DNS_DEBUG, ("dns_lookup: \"%s\": found = ", name));
ip_addr_debug_print_val(DNS_DEBUG, dns_table[i].ipaddr);
LWIP_DEBUGF(DNS_DEBUG, ("\n"));
if (addr) {
ip_addr_copy(*addr, dns_table[i].ipaddr);
}
return ERR_OK;
}

The dns_table state is never DNS_STATE_DONE ?

Do you have an idea on what might be happening here ?


Kind regards 

Thomas