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

nRF9160 Modem Firmware v1.0.0: Setting custom DNS server

Hello,

The release-notes of the Modem Firmware v1.0.0 for the nRF9160 state that there is now "Support for DNS server address setting by application.". However, I cannot find how to actually use this feature anywhere.

Is there perhaps an AT-command that is not documented yet? I'm looking at the AT Command Reference v1.0.

Can someone please help me out?

Parents Reply
  • Hello,

    it worked with GoogleDNS! (8.8.8.8).

    Now DNS resolving is working.

    #include <nrf_socket.h>
    
    struct nrf_in_addr dns;
    dns.s_addr = 134744072; // Google DNS, 8.8.8.8
    const int err = nrf_setdnsaddr(2, &dns);
    printk("DNS set result %d\n", err);

    It can be called before the rest of modem configuration, i.e. before w_lte_lc_init in lte_lc.c

    However:

    1) I needed to give 2 as first parameter, not 1.

    2) AT+CGCONTRDP=0 still shows only APN set, no DNS

    3) I would expect it to work with various DNS Servers, including OpenDNS  (208.67.222.222 and 208.67.222.220)

Children
No Data
Related