Custom DNS Set on SDK 3.1

Hi, 

We have a client using one of our products, and their local NB-IoT network was giving us some issues, I travelled over to try and work out what was going on, and it was to do with the network not have DNS server, so it couldn't resolve server IP addresses. It is now working fine using the suggested answer in this thread.

 nRF9160 Modem Firmware v1.0.0: Setting custom DNS server 

However, our product is still using SDK1.6.1, and modem FW 1.3.1, I am currently in the middle of trying to port across our firmware to the latest SDK. The fix in the above was to use the function
 

struct nrf_in_addr dns;
dns.s_addr = 134744072; // Google DNS, 8.8.8.8
const int err = nrf_setdnsaddr(2, &dns);

But I cant find this function, or an equivalent in SDK 3.1. Can you point me in the right direction?

Thanks, 

Damien 

Parents Reply
  • Thanks Michal,

    CONFIG_NETWORKING=y
    CONFIG_NET_NATIVE=y
    CONFIG_DNS_RESOLVER=y
    CONFIG_DNS_SERVER_IP_ADDRESSES=y
    CONFIG_DNS_SERVER1="8.8.8.8"

    After a bit of searching I found that this configuration builds with a 9160, and when I debug, it gets to this function in zephr/subsys/net/lib/dns/resolve.c

    dns_resolve_init_default(dns_resolve_get_default());
    But it gets a -13 error (EACCES - permission denied)
    I will keep looking into it. 
    Thanks,
    Damien
Children
Related