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 Children
  • 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
  • You're welcome.

    Does that mean you're fine on your own, or anything more I should look into here?

    And of course, if you have any more questions, please just ask us on DevZone. We're here to help.

    Best regards,

    Michal

  • Hi Michal, 

    Well I can try and work out why it is failing there, and if I do I will update this thread. However, I am not sure how I would test that it works. The only network I know of that has the DNS issue is a 1 hour plane journey away, so ideally I need a way to ensure it works before pushing FW updates to units on that network. Do you know of a way I can test this? 

    Thanks, 

    Damien

  • Maybe you could check using Cellular Monitor and Wireshark if a test device is communicating with a chosen DNS server?

    Best regards,

    Michal

  • Hi Michal, 

    Whilst searching for something else I stumbled across these Config options

    CONFIG_LTE_LC_DNS_FALLBACK_MODULE=y
    CONFIG_LTE_LC_DNS_FALLBACK_ADDRESS="8.8.8.8"

    If I look at the LTC_LC Debug, I see

    <dbg> lte_lc: dns_fallback_set: Fallback DNS address successfully set to 8.8.8.8


    So I am assuming it works in the same way as the old fix. 

    However, as it's a fallback I cannot test whether this does fix the problem with certain networks, and I don't think I'll be able to convince my boss to give me a free holiday again. 
    I will try and get a test board sent over to our customer over there and see if they can test it for us. 

    Thanks, 

    Damien

Related