I try to use dns in conjunction with a dhcp. In some network I get error DNS_QUERY_FAILED when trying nx_dns_host_by_name_get()
I use the following code:
...
status = nx_dhcp_user_option_retrieve( &g_dhcp_client0, NX_DHCP_OPTION_DHCP_SERVER, dnsIpString, &dnsIpSize);
dnsIpAdr = nx_dhcp_user_option_convert( dnsIpString );
dnsIpAdr = __REV(dnsIpAdr); // convert big endian to little endian
status = nx_dns_server_add(&g_dns0, dnsIpAdr);
status = nx_dns_host_by_name_get(&g_dns0, cloudSvrUrl, &cloudSvrIpAdr, 500);
if(NX_SUCCESS != status) {
g_ioport.p_api->pinWrite(Leds.p_leds[BSP_LED_LED2], IOPORT_LEVEL_LOW); // LED red
printf(" ERROR: DNS Server add Error Code 0x%X \n", status);
while(1);
}
in a case were
assigned IP address 192.168.1.101
assigned Netw Mask 255.255.255.0
assigned Gateway address 192.168.1.100
1 DNS IP address 192.168.1.100
it works BUT if I have:
assigned IP address 192.168.8.136
assigned Netw Mask 255.255.255.0
assigned Gateway address 192.168.8.1
1 DNS IP address 192.168.7.129
Administrator told me that host name is wrong in DHCP/DNS
Please help