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

nrf91 modem library custom DNS and nrf_setdnsaddr() support status

Hi,

We are developing a device that should work in multiple mobile networks, and some of these are known to provide no DNS server. As using a fixed IP address for our cloud endpoint isn't an attractive option, we have to provide a custom DNS server address. The documentation for NCS 1.5.1/ nrf_modem 1.0.1 library states that "The DNS address management protocol is not yet implemented." nrf_setdnsaddr() is listed, but not documented. Acccording to this ticket it does work, but what is its support status? Also, is it possible to list multiple/fallback DNS servers this way?

Alternatively, is it possible to send DNS requests from application via UDP sockets (i. e. it wouldn't be blocked by the modem)? As far as I'm able to tell from the docs, Zephyr DNS resolver works via net_context API, so it's unusable with nrf91 LTE connection, as modem library works via NET_SOCKETS_OFFLOAD, bypassing net_context. Hence we would have to include an external resolver module.

Parents
  • Hi!

    The support status is that this functionality is supported in the master branch of NCS but not in any official release. So it will be supported in the next release of NCS.

    Correction: This function has been supported since BSDlib 0.6.1.

    There is documentation for this function here: nrfxlib/nrf_modem/include/nrf_socket.h L1914-L1928

    I'm not sure if it's possible to list multiple DNS servers, but I will look into that and get back to you. 

    I believe it's possible to send DNS requests from the application via UDP sockets, but I will check this as well.

    Best regards,

    Heidi

  • Hey

    We've got the same problem. Have you already got any further information? We are mainly interested if nrf_setdnsaddr overwrites the default DNS or creates a fallback DNS. Unfortunately the documentation is empty except the function signature.

    Edit: We've found some documentation in the nrf_socket.h header:

    https://github.com/nrfconnect/sdk-nrfxlib/blob/v1.5.1/nrf_modem/include/nrf_socket.h

    /**
     * @brief Set a secondary DNS address.
     *
     * @details The secondary DNS address is used automatically in case the primary DNS
     *          address is unreachable, or if no DNS address is provided by the operator.
     *          The secondary DNS address does not override the primary DNS address.
     *
     * @param[in] family    Address family.
     * @param[in] in_addr   An IPv4 or IPv6 address encoded in a nrf_in_addr or
     *                      nrf_in6_addr structure, respectively.
     *                      Pass @c NULL to unset the secondary DNS address.
     *
     * @return int Zero on success, or an  error from @file nrf_modem/include/nrf_errno.h
     *             otherwise.
     */
    int nrf_setdnsaddr(int family, const void *in_addr);

    So it seems that it sets just a fallback. Could you please confirm that?

    Regards
    Samuel

Reply
  • Hey

    We've got the same problem. Have you already got any further information? We are mainly interested if nrf_setdnsaddr overwrites the default DNS or creates a fallback DNS. Unfortunately the documentation is empty except the function signature.

    Edit: We've found some documentation in the nrf_socket.h header:

    https://github.com/nrfconnect/sdk-nrfxlib/blob/v1.5.1/nrf_modem/include/nrf_socket.h

    /**
     * @brief Set a secondary DNS address.
     *
     * @details The secondary DNS address is used automatically in case the primary DNS
     *          address is unreachable, or if no DNS address is provided by the operator.
     *          The secondary DNS address does not override the primary DNS address.
     *
     * @param[in] family    Address family.
     * @param[in] in_addr   An IPv4 or IPv6 address encoded in a nrf_in_addr or
     *                      nrf_in6_addr structure, respectively.
     *                      Pass @c NULL to unset the secondary DNS address.
     *
     * @return int Zero on success, or an  error from @file nrf_modem/include/nrf_errno.h
     *             otherwise.
     */
    int nrf_setdnsaddr(int family, const void *in_addr);

    So it seems that it sets just a fallback. Could you please confirm that?

    Regards
    Samuel

Children
Related