cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F4 ==> LwIP_DNS

snaghyun choi
Associate III

Hello sir,

I want to use DNS for my project, but it is not easy,

I need your help.

From now, I succeed to port IP address. but it is failed to use DNS.

I set the DNS on the STMC32CUBEMX and checked in the file <<Lwipopts.h>>

=================

Procedure

  1. MX_LWIP_Init()
  2. dns_init()
  3. get the ip addresss use ""dns_gethostbyname()""

void dns_found(const char *name,ip_addr_t *addr,void *arg)

{

  LWIP_UNUSED_ARG(arg);

 printf(" dns \r\n");

  printf("%s: %s\n", name, addr ? ip_ntoa(addr) : "<not found>");

}

void get_IP(void)

{

 int test=dns_gethostbyname("www.freertos.com",&resolved,dns_found,NULL);

 printf("error = %d \r\n",test);

}

=================

Finally, I received error = -6

How can I get the ip address to use above Domain Name?

Best regards,

Choi.

0 REPLIES 0