This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Using getaddrinfo for DNS-Lookups (nrf9160 DK)

Hello!

I'm currently trying to run the mqtt_simple sample (latest version of nrf-zephyr) on the nrf9160 DK. Unfortunately it is not working, because getaddrinfo() returns 22 (EINVAL?).

I'm trying to run the sample using NB-IoT. For that I flashed the appropriate firmware (pre-alpha) and I'm also using an appropriate SIM-card. TCP connections alone (without getaddrinfo()) are working and I'm able to exchange data with a server over the internet.

Specifically the DNS-lookup with getaddrinfo() seems to run into trouble. I also tried to pass an IP-Address to getaddrinfo(). In that case it returns no error, but gives incomplete results (Address correct, but hints about e.g. socktype ignored).

My best guess would be that the nrf_getaddrinfo() implementation is incomplete here. I would be happy about any information about this.

Parents Reply
  • Hi Stefan Dennig,

    The feature is implemented in the Modem but not implemented in BSD lib yet, i.e. not available at application level.

    For information regarding release schedules and roadmaps, please contact your local Regional Sales Manager(RSM). If you do not have the RSM contact information, then let me know where you're based in a PM and I will provide you with the local RSMs contact info.

Children
  • Hi, this is also quite important for us.

    Any update on this one?

    All currently available Release Notes state that it IS possible (even with 'Support for 4 DNS server addresses.')
    (Versions 1.0.0 through 1.1.1)

    I tried command AT+CDNSCFG but it does not seem to be supported, I get an error back.
    AT+CGCONTRDP also return empty strings for DNS addresses.

    It is really vital for our project, our electrical engineers chose NRF91 because of quite impressive low power charactersistics, but we really need to get DNS resolving working!

    Thank you!

Related