cancel
Showing results for 
Search instead for 
Did you mean: 

How to check that my hostname is stored in DNS server

Aahai.1
Associate

Hello,

I am working with an STM32F4. My goal is to be able to access to the board using its hostname. From what I've seen, to get it done I have to :

   set LWIP_NETIF_HOSTNAME to 1

   set LWIP_DHCP to 1

I also set LWIP_DNS to 1.

I made few modification in the code :

void StartDefaultTask(void const * argument)
{
  /* init code for LWIP */
  MX_LWIP_Init();
 
	while(!dhcp_supplied_address(&gnetif))
	{
	osDelay(1);
	}
	printf("sucess\n");
	ip4_addr_t *ipadddr = netif_ip4_addr(&gnetif);
	ip4_addr_t *maskadddr = netif_ip4_netmask(&gnetif);
 
	printf("ip : %08X\n", ipadddr->addr);
	printf("mask : %08X\n", maskadddr->addr);
 
	for(;;)
	{
 
	}
  /* USER CODE END 5 */
}

When my board wakes up. I can see with wireshark that it asks my router for an IP Address, then it tries with 192.168.1.17. Every thing seems to be OK because my STM32 sets its IP to 192.168.1.17, and I can ping my board "ping 192.168.1.17"

0693W00000JMU5zQAH.pngWhen I am looking for its hostname I can see that when STM32 sends DHCP request it also sends its hostname “stm32.lwip�?.

0693W00000JMU4SQAX.png 

So everything seems to be fine.

But when I try to ping my board “ping stm32.lwip�?, it does not work. My computer sends a DNS query for stm32.lwip, and my router sends back that no IP is associated with “stm32.lwip�?.

0693W00000JMU5RQAX.png 

I am not familiar with DNS/DHCP, so did I make something wrong ?

Why isn’t my hostname stored in my router ?

How can I check for my router internal DNS values ?

How can I send again my hostname and IP Address to DNS server ?

Thank you,

0 REPLIES 0