Hi,
I have a problem to send an UDP packet to global DNS like Google DNS 8.8.8.8. I always get host unresolved error. When I try to send to local ip(my pc 192.168.10.76, my controller 192.168.10.10), I got no problem.
Can anyone please advice?
Thank you.
Solved! Go to Solution.
Hi David,
Thank for fast respond.
I just found my problem, I didn't enable gateway.
Now, I'm able to send UDP to internet already.
Thank you,
I have a problem with dns, dns did not work. I have the k60 module with MQX 3.7 operating system. The dns's introduce this:
while (DNS_init ()! = RTCS_OK)
{
_time_delay (1000);
}
strcpy (string, "google.com.");
host = gethostbyname (string);
while (host == NULL)
{
if (host! = NULL) {
name = host-> h_name;
alias1 = host-> h_aliases [0];
name2 = host-> h_aliases [1];
type = host-> h_addrtype;
length = host-> h_length;
ipDNS = * (uint_32_ptr) host-> h_addr_list [0];
}
host = gethostbyname (string);
}
When initializing the ethernet I have to call the function ipcg_add_dns?
ipcfg_init_device (DEMOCFG_DEFAULT_DEVICE, address);
_ip_address DNS_server_ipaddr;
DNS_server_ipaddr = inet_addr ("8.8.8.8");
if (ipcfg_add_dns_ip (DEMOCFG_DEFAULT_DEVICE, DNS_server_ipaddr) == TRUE)
{
printf ("DNS added ok");
} else {
printf ("DNS added NOT ok");
}
In addition to the file dnshosts.c must configure something?
thank you
Hi David,
Thank for fast respond.
I just found my problem, I didn't enable gateway.
Now, I'm able to send UDP to internet already.
Thank you,