Has anyone used " RTCSCFG_ENABLE_LWDNS" set to 1 and RTCSCFG_ENABLE_DNS set to 0 to resolve an internet name into an address?
I am using CW 7.2 with MQX3.6.
I know I could enable DNS but its a memory sponge and eats up 5K of static space plus dynamic space putting me close to overflow.
I am currently trying the following code.
void get_host_ip()
{
char string[30];
_ip_address ipaddr, srvaddr;
char ipname[30];
uint_32 ipnamesize;
srvaddr = 0xc80640107;
strcpy(string, "dyn.com");
strcpy(ipname,"128.100.1.182");
ipnamesize = strlen(string);
ipcfg_add_dns_ip(IPCFG_default_enet_device,srvaddr);
if(RTCS_resolve_ip_address( string, &ipaddr,ipname,ipnamesize))
{
sprintf(string,"ip %x", ipaddr);
}
else
sprintf(string,"fail");
}
All I want to do is to be able to get the ip address for a domain name.