How to get DNS address?

I’m using Connect ME9210 with NET+OS.

Is there any way to read DNS address when DHCP is enabled? I use ‘customizeIamGetIfAddrInfo()’ which gives me current IP, subnet mask, gateway, but DNS is reported as
Even if I disable the DHCP and it uses “APP_PRIMARY_DNS_ADDRESS” defined in “appconf.h”, the function still returns DNS as zero.

Many thanks for suggestions

are you running Netos 7.5.2 with all the patches?
are you able to run: C:
adnsclnt\ example app? Works fine here


yes I’m running NETOS 7.5.2. All patches installed.

The example works fine. Thanks for it. The function “DNSGetServers()” works fine for me. I can use it instead of “customizeIamGetIfAddrInfo()”.

Also, does the NETOS use DNS translation when it boots up? Meaning, can I configure for example SNTP server by its name instead of address?


instead of


Thanks for answer

i beleive it has to be the IP, but you can easily change this. It is used in C:


  • Returns the value of @link APP_SNTP_PRIMARY as defined in appconf.h
  • @external
  • @include “appconf_api.h”
  • @category SystemSWServices:ApplicationConfiguration
  • @since 6.0
  • @return IP-Address IP Address of primary SNTP server.
  • @return NULL APP_SNTP_PRIMARY is not defined.
    char * NAGetAppSntpPrimary(void)
    return (APP_SNTP_PRIMARY);
    return (NULL);

chust change this function so it will accept hostname and resolve it.


Thanks for suggestion.
I’ve tried to modify the function, but the problem is if you want to translate the host name using “getaddrinfo()” inside the function “NAGetAppSntpPrimary()” it does not work. It just get stuck. I guess the problem is that network connection is not established yet while calling the function “NAGetAppSntpPrimary()” and so it cannot access the DNS.

So it seems the only option is to use just an IP address.

Thank you