<?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>https_client returning &amp;quot;getaddrinfo() failed, err 9&amp;quot;</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/60203/https_client-returning-getaddrinfo-failed-err-9</link><description>I am based in Hong Kong. I purchased NB-IoT sim card with &amp;quot;Three&amp;quot;. 
 When using LTE Link Monitor, (with at_client) I can connect to the NB_IoT network, as Three support told me they can see my sim connected. 
 When I try https_client sample, I get &amp;quot;getaddrinfo</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 28 Apr 2020 14:21:24 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/60203/https_client-returning-getaddrinfo-failed-err-9" /><item><title>RE: https_client returning "getaddrinfo() failed, err 9"</title><link>https://devzone.nordicsemi.com/thread/247141?ContentTypeID=1</link><pubDate>Tue, 28 Apr 2020 14:21:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1dbf23bf-54bd-45a3-af78-d4e472170f68</guid><dc:creator>Saketaram</dc:creator><description>&lt;p&gt;Thanks. The telecom provider didn&amp;#39;t enable DNS.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: https_client returning "getaddrinfo() failed, err 9"</title><link>https://devzone.nordicsemi.com/thread/244856?ContentTypeID=1</link><pubDate>Thu, 16 Apr 2020 06:49:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c17e0894-28a0-4597-80ab-1d0307c4b6b6</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thank you for the logs and testing this.&lt;/p&gt;
&lt;p&gt;Unfortunately, this shows that your local carrier does not provide DNS.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;When testing examples, you can manually resolve the hostname, for instance:&lt;/p&gt;
&lt;p&gt;mqtt.eclipse.org resolves to &amp;quot;137.135.83.217&amp;quot; when I ping it at my end, then you can set this as the prj.conf::CONFIG_MQTT_BROKER_HOSTNAME=&amp;quot;137.135.83.217&amp;quot;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Alternative can be to manually set the DNS, as a user has done in this post:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/50029/nrf9160-modem-firmware-v1-0-0-setting-custom-dns-server/235419#235419"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/50029/nrf9160-modem-firmware-v1-0-0-setting-custom-dns-server/235419#235419&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: https_client returning "getaddrinfo() failed, err 9"</title><link>https://devzone.nordicsemi.com/thread/244767?ContentTypeID=1</link><pubDate>Wed, 15 Apr 2020 14:16:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:045e2efe-0497-4ec4-99f5-6f710b1a7a6e</guid><dc:creator>Saketaram</dc:creator><description>&lt;p&gt;Trying mqtt_simple.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I added the last 3 lines to prj.conf&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;#
# Copyright (c) 2019 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-BSD-5-Clause-Nordic
#

# Networking
CONFIG_NETWORKING=y
CONFIG_NET_NATIVE=n
CONFIG_NET_SOCKETS_OFFLOAD=y
CONFIG_NET_SOCKETS=y
CONFIG_NET_SOCKETS_POSIX_NAMES=y

# LTE link control
CONFIG_LTE_LINK_CONTROL=y
CONFIG_LTE_AUTO_INIT_AND_CONNECT=n

# BSD library
CONFIG_BSD_LIBRARY=y

# AT Host
CONFIG_UART_INTERRUPT_DRIVEN=y
CONFIG_AT_HOST_LIBRARY=y

# MQTT
CONFIG_MQTT_LIB=y
CONFIG_MQTT_LIB_TLS=n

# Appliaction
#CONFIG_MQTT_PUB_TOPIC=&amp;quot;/my/publish/topic&amp;quot;
#CONFIG_MQTT_SUB_TOPIC=&amp;quot;/my/subscribe/topic&amp;quot;
#CONFIG_MQTT_CLIENT_ID=&amp;quot;my-client-id&amp;quot;
#CONFIG_MQTT_BROKER_HOSTNAME=&amp;quot;mqtt.eclipse.org&amp;quot;
#CONFIG_MQTT_BROKER_PORT=1883

# Main thread
CONFIG_MAIN_STACK_SIZE=4096

CONFIG_HEAP_MEM_POOL_SIZE=2048

CONFIG_LTE_NETWORK_MODE_LTE_M=n
CONFIG_LTE_NETWORK_MODE_NBIOT=y

CONFIG_LTE_AUTO_INIT_AND_CONNECT=y&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Then I compiled and flashed through command line.&lt;/p&gt;
&lt;p&gt;And with PuTTY, I got this message:&lt;pre class="ui-code" data-mode="text"&gt;*** Booting Zephyr OS build v2.1.99-ncs1  ***
+CEREG: 2,&amp;quot;0BF4&amp;quot;,&amp;quot;099E5765&amp;quot;,9,0,0,&amp;quot;11100000&amp;quot;,&amp;quot;11100000&amp;quot;
+CEREG: 1,&amp;quot;0BF4&amp;quot;,&amp;quot;099E5765&amp;quot;,9,,,&amp;quot;11100000&amp;quot;,&amp;quot;11100000&amp;quot;
The MQTT simple sample started
ERROR: getaddrinfo failed 22
ERROR: mqtt_connect -47&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1586960144485v2.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Does it clarify?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: https_client returning "getaddrinfo() failed, err 9"</title><link>https://devzone.nordicsemi.com/thread/244678?ContentTypeID=1</link><pubDate>Wed, 15 Apr 2020 10:44:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cde6a4e4-ef31-418c-98a4-5a9a2b5c2a57</guid><dc:creator>Saketaram</dc:creator><description>&lt;p&gt;I will.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;For the record, when I previously used LTE LInk Monitor and set&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;AT+CFUN=4
AT%XSYSTEMMODE=0,1,1,0
AT+CFUN=1
AT+CFUN?&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I got this screen.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1586947432627v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Is this related to DNS?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: https_client returning "getaddrinfo() failed, err 9"</title><link>https://devzone.nordicsemi.com/thread/244674?ContentTypeID=1</link><pubDate>Wed, 15 Apr 2020 10:27:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e9256078-3886-4d9d-95f0-c155a8b12b8e</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Does your local carrier&amp;nbsp;provide a DNS?&lt;/p&gt;
&lt;p&gt;Could you try other examples, like mqtt_simple, to see if this works?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Remember to set &amp;quot;CONFIG_LTE_NETWORK_MODE_NBIOT=y&amp;quot; in prj.conf file before building.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>