<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>nRF9160 Modem Firmware v1.0.0: Setting custom DNS server</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/50029/nrf9160-modem-firmware-v1-0-0-setting-custom-dns-server</link><description>Hello, 
 The release-notes of the Modem Firmware v1.0.0 for the nRF9160 state that there is now &amp;quot;Support for DNS server address setting by application.&amp;quot;. However, I cannot find how to actually use this feature anywhere. 
 Is there perhaps an AT-command</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 20 Feb 2020 11:33:05 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/50029/nrf9160-modem-firmware-v1-0-0-setting-custom-dns-server" /><item><title>RE: nRF9160 Modem Firmware v1.0.0: Setting custom DNS server</title><link>https://devzone.nordicsemi.com/thread/235419?ContentTypeID=1</link><pubDate>Thu, 20 Feb 2020 11:33:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0a934660-de43-42e4-bdcd-c2b6bffb4ee2</guid><dc:creator>Andrey Dodonov</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;it worked with GoogleDNS! (8.8.8.8).&lt;/p&gt;
&lt;p&gt;Now DNS resolving is working.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;#include &amp;lt;nrf_socket.h&amp;gt;

struct nrf_in_addr dns;
dns.s_addr = 134744072; // Google DNS, 8.8.8.8
const int err = nrf_setdnsaddr(2, &amp;amp;dns);
printk(&amp;quot;DNS set result %d\n&amp;quot;, err);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;It can be called before the rest of modem configuration, i.e. before&amp;nbsp;w_lte_lc_init in lte_lc.c&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;However:&lt;/p&gt;
&lt;p&gt;1) I needed to give 2 as first parameter, not 1.&lt;/p&gt;
&lt;p&gt;2)&amp;nbsp;AT+CGCONTRDP=0 still shows only APN set, no DNS&lt;/p&gt;
&lt;p&gt;3) I would expect it to work with various DNS Servers, including OpenDNS&amp;nbsp;&lt;span&gt;&amp;nbsp;(208.67.222.222 and&amp;nbsp;208.67.222.220)&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 Modem Firmware v1.0.0: Setting custom DNS server</title><link>https://devzone.nordicsemi.com/thread/235410?ContentTypeID=1</link><pubDate>Thu, 20 Feb 2020 11:06:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e20da272-4cf1-47aa-b73e-534e4b46a89a</guid><dc:creator>Andrey Dodonov</dc:creator><description>&lt;p&gt;Hi, thank for you for a quick reply!&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;Is there any info on using that?&lt;/p&gt;
&lt;p&gt;nrfxlib/bsdlib/include/nrf_socket.h states that the first argument is IP family, which is according to&amp;nbsp;&lt;br /&gt;&lt;a href="https://www.iana.org/assignments/address-family-numbers/address-family-numbers.xhtml"&gt;https://www.iana.org/assignments/address-family-numbers/address-family-numbers.xhtml&lt;/a&gt;&lt;br /&gt;should be 1 for IP4, but then the funciton gives back error 22 (invalid parameter).&lt;/p&gt;
&lt;p&gt;With 2 it gives back 0 error code, but then&amp;nbsp;AT+CGCONTRDP=0 still shows that DNS is not set, and getaddrinfo results in error 60 (timeout).&lt;/p&gt;
&lt;p&gt;I am trying to use OpenDNS (208.67.222.222 and&amp;nbsp;208.67.222.220), obviously converted to uint32, as the function requires.&lt;/p&gt;
&lt;p&gt;So, &lt;em&gt;any example&lt;/em&gt; (even small code snippet) on how to set OpenDNS addresses would be &lt;em&gt;HIGHLY&lt;/em&gt;&amp;nbsp;&lt;em&gt;APPRECIATED&lt;/em&gt;. Ideally both (primary and secondary), but this function states that it sets only secondary... But at least something to get DNS working.&lt;/p&gt;
&lt;p&gt;Thank you so much!&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;P.S.&amp;nbsp;Source code of this function is not open source, or? Then we could look into implementation/used AT command and not bother you.&lt;/p&gt;
&lt;p&gt;But it looks like controlling the modem happens not just via AT commands.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 Modem Firmware v1.0.0: Setting custom DNS server</title><link>https://devzone.nordicsemi.com/thread/235139?ContentTypeID=1</link><pubDate>Wed, 19 Feb 2020 10:45:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fcb04b2b-1369-4216-8dff-0c04abe7569e</guid><dc:creator>Didrik Rokhaug</dc:creator><description>&lt;p&gt;Hi.&lt;/p&gt;
&lt;p&gt;With NCS v1.2.0 setting a custom DNS server address should now be possible.&lt;/p&gt;
&lt;p&gt;Take a look at the release notes and bsdlib documentation:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrfxlib/bsdlib/doc/CHANGELOG.html"&gt;https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrfxlib/bsdlib/doc/CHANGELOG.html&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrfxlib/bsdlib/doc/api.html#_CPPv414nrf_setdnsaddriPKv"&gt;https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrfxlib/bsdlib/doc/api.html#_CPPv414nrf_setdnsaddriPKv&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Didrik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 Modem Firmware v1.0.0: Setting custom DNS server</title><link>https://devzone.nordicsemi.com/thread/235120?ContentTypeID=1</link><pubDate>Wed, 19 Feb 2020 10:07:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:94fe2e46-08a2-4555-a4ea-0b72bd0e99c4</guid><dc:creator>Andrey Dodonov</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;this is also quite important for us.&lt;/p&gt;
&lt;p&gt;Any update on this one?&lt;br /&gt;&lt;br /&gt;All currently available Release Notes state that it IS possible (even with &amp;#39;Support for 4 DNS server addresses.&amp;#39;)&lt;br /&gt;(Versions 1.0.0 through 1.1.1)&lt;br /&gt;&lt;br /&gt;I tried command &lt;strong&gt;AT+CDNSCFG&lt;/strong&gt; but it does not seem to be supported, I get an error back.&lt;br /&gt;&lt;strong&gt;AT+CGCONTRDP&lt;/strong&gt; also return empty strings for DNS addresses.&lt;/p&gt;
&lt;p&gt;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!&lt;/p&gt;
&lt;p&gt;Thank you!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 Modem Firmware v1.0.0: Setting custom DNS server</title><link>https://devzone.nordicsemi.com/thread/219328?ContentTypeID=1</link><pubDate>Fri, 08 Nov 2019 15:54:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:652b684a-ab8a-41d8-a642-10575ab70a67</guid><dc:creator>Gurkan</dc:creator><description>&lt;p&gt;Is there any update on this issue?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 Modem Firmware v1.0.0: Setting custom DNS server</title><link>https://devzone.nordicsemi.com/thread/203591?ContentTypeID=1</link><pubDate>Mon, 12 Aug 2019 12:44:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:91f43731-abdd-4b9f-a1c1-28deb6ffed71</guid><dc:creator>Didrik Rokhaug</dc:creator><description>&lt;p&gt;Hi, and apologies for the slow response, but with summer vacations here in Norway it has been hard to find someone able to answer this question.&lt;/p&gt;
&lt;p&gt;Sadly, while the modem supports setting of custom DNS server address, there is no support for this on the application side.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Didrik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>