How do I use Lightweight DNS services

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How do I use Lightweight DNS services

976 Views
drummer
Contributor IV

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.

Labels (1)
Tags (1)
0 Kudos
Reply
2 Replies

733 Views
DavidS
NXP Employee
NXP Employee

Hi Rick,

First which ColdFire device are you using?

CW7.2+MQX_3.6 are very old products and now mothballed and do not have active support. 

Second if you are in the development process I would strongly recommend the Kinetis K family.  It has up-to-date development tools and MQX support.

MQX_4.1.1+CW10.6 support for MCF52259 and MCF54418 devices.  Both have Tower hardware available:  http://www.freescale.com/tower

Free tools that support Kinetis device and having MQX support.

KDS - http://www.freescale.com/kds   IDE

KSDK - http://www.freescale.com/ksdk Software API to on-chip peripherals

Purchaseable tools:

IAR and Keil.

Regards,

David

0 Kudos
Reply

733 Views
drummer
Contributor IV

The problem is that there are now 10,000 units in the field and production is now ramping up.

We cant be expected to change hardware and MQX versions that have been qualified by approval agencies all over the world every time we need to add a feature.

We have to use what we got.

The solution was to fix the bugs in the MQX 3.6 version mainly the resolver.c file domains_equal subroutine.

I now can use the lightweight DNS soulution.

error = LWDNS_resolve(&name_to_resolve, &ipaddr, ipname, ipnamesize);
if(error)
resolve_ip = ipaddr;
else
resolve_ip = 0;
0 Kudos
Reply