# Data connect fails due to missing DNS

**URL:** <https://forum.legato.io/t/data-connect-fails-due-to-missing-dns/4720>\
**Category:** Legato Application Framework\
**Created:** [September 18, 2019, 2:38pm UTC](https://forum.legato.io/t/data-connect-fails-due-to-missing-dns/4720 "2019-09-18T14:38:10Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Maroua](https://avatars.discourse-cdn.com/v4/letter/m/839c29/32.png) [@Maroua](https://forum.legato.io/u/Maroua)\
**Post date:** [September 18, 2019, 2:38pm UTC](https://forum.legato.io/t/data-connect-fails-due-to-missing-dns/4720/1 "2019-09-18T14:38:10Z")

</div>

Hello, I have a WP7700 red and I’m Following the getting started tutorial. I reached the point where I’m supposed to run redSensorToCloud in order to connect to the Cloud. However, this didn’t seem to work so I tried “cm data connect” and I figured out that the device didn’t connect because of the missing DNS I checked again and Indeed in the info the two DNS fields are empty(N/A). So I am sure that the sim card I have doesn’t offer DNS. Any idea how can I proceed ?

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [September 18, 2019, 2:54pm UTC](https://forum.legato.io/t/data-connect-fails-due-to-missing-dns/4720/2 "2019-09-18T14:54:51Z")

</div>

How about editng the /etc/resolv.conf file?

> **[Setup DNS Resolution With "resolv.conf" in Examples - ShellHacks](https://www.shellhacks.com/setup-dns-resolution-resolvconf-example/)**
>
> The /etc/resolv.conf configuration file contains information that allows a computer to convert alpha-numeric domain names into the numeric IP addresses. The process of converting domain names to IP addresses is called resolving. When using DHCP,...

---

<div class="post-metadata">

**Author:** ![Maroua](https://avatars.discourse-cdn.com/v4/letter/m/839c29/32.png) [@Maroua](https://forum.legato.io/u/Maroua)\
**Post date:** [September 18, 2019, 3:55pm UTC](https://forum.legato.io/t/data-connect-fails-due-to-missing-dns/4720/3 "2019-09-18T15:55:31Z")

</div>

Actually I Don’t seem to find this file Under etc…

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [September 19, 2019, 3:14am UTC](https://forum.legato.io/t/data-connect-fails-due-to-missing-dns/4720/4 "2019-09-19T03:14:22Z")

</div>

I can see it in WP76 module.

root@swi-mdm9x28:~# cat /etc/resolv.conf  
nameserver 10.145.148.1  
nameserver 10.144.148.133  
root@swi-mdm9x28:~#  
root@swi-mdm9x28:~# cm data  
Index: 1  
APN: hkcsl  
PDP Type: IPV4V6  
Connected: no  
root@swi-mdm9x28:~#  
root@swi-mdm9x28:~# cm info  
Device: WP7608  
IMEI: 352913090100734  
IMEISV: 4  
FSN: XG805285330204  
Firmware Version: SWI9X07Y\_02.16.02.00 000000 jenkins 2018/04/19 19:59:02  
Bootloader Version: SWI9X07Y\_02.16.02.00 000000 jenkins 2018/04/19 19:59:02  
[511.647542] i2c-msm-v2 78b8000.i2c: NACK: slave not responding, ensure its powered: msgs(n:1 cur:0 tx) bc(rx:0 tx:2) mode:FIFO slv\_addr:0x3a MSTR\_STS:0x081343c8 OPER:0x00000090  
MCU Version: 002.009  
PRI Part Number (PN): 9907762  
PRI Revision: 001.001  
Carrier PRI Name: GENERIC  
Carrier PRI Revision: 002.032\_000  
SKU: 1103788  
Last Reset Cause: Power Down  
Resets Count: Expected: 526 Unexpected: 9

---

<div class="post-metadata">

**Author:** ![JordanZhao](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jordanzhao/32/789_2.png) [@JordanZhao](https://forum.legato.io/u/JordanZhao)\
**Post date:** [September 19, 2019, 9:34am UTC](https://forum.legato.io/t/data-connect-fails-due-to-missing-dns/4720/5 "2019-09-19T09:34:20Z")

</div>

How about “touch /etc/resolv.conf” and restart cm data connect?

---

<div class="post-metadata">

**Author:** ![raf](https://avatars.discourse-cdn.com/v4/letter/r/848f3c/32.png) [@raf](https://forum.legato.io/u/raf)\
**Post date:** [September 20, 2019, 5:17am UTC](https://forum.legato.io/t/data-connect-fails-due-to-missing-dns/4720/6 "2019-09-20T05:17:41Z")

</div>

As you’ve suggested @JordanZhao.  
We do that during our production testing, else the modems can’t establish a data connection.

---

<div class="post-metadata">

**Author:** ![fdu](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/fdu/32/811_2.png) [@fdu](https://forum.legato.io/u/fdu)\
**Post date:** [September 23, 2019, 11:08am UTC](https://forum.legato.io/t/data-connect-fails-due-to-missing-dns/4720/7 "2019-09-23T11:08:33Z")

</div>

Hi  
which bearer are you using ?  
Can you give the response of the following AT commands ?  
AT!SELACQ?  
AT!SELCIOT?

---

<div class="post-metadata">

**Author:** ![Maroua](https://avatars.discourse-cdn.com/v4/letter/m/839c29/32.png) [@Maroua](https://forum.legato.io/u/Maroua)\
**Post date:** [September 23, 2019, 11:55am UTC](https://forum.legato.io/t/data-connect-fails-due-to-missing-dns/4720/8 "2019-09-23T11:55:21Z")

</div>

Hello so when I created the file I put the google dns (8.8.8.8 and 8.8.8.4) within. When I run cm data connect it says that it is connected but I Don’t see anything on the airvantage. Is there a way to see the traffic at the level of the device ?  
@fdu here is what I get for these commands:  
AT!SELACQ?  
!SELACQ:  
LTE  
LTE-M1  
LTE-NB1  
GSM

OK

And the second command :  
AT!SELCIOT?  
current operating mode : 0x06  
supported operated modes:  
LTE WB: 0x01  
LTE M1: 0x02  
LTE NB1: 0x04

OK

---

<div class="post-metadata">

**Author:** ![fdu](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/fdu/32/811_2.png) [@fdu](https://forum.legato.io/u/fdu)\
**Post date:** [September 23, 2019, 12:07pm UTC](https://forum.legato.io/t/data-connect-fails-due-to-missing-dns/4720/9 "2019-09-23T12:07:45Z")

</div>

Sorry @Maroua  
I forgot these 2 commands:  
AT+CREG=2  
AT+CREG?  
The aim is to know the current activated beader: LTE-M1 or LTE-NB1

Thanks

---

<div class="post-metadata">

**Author:** ![Maroua](https://avatars.discourse-cdn.com/v4/letter/m/839c29/32.png) [@Maroua](https://forum.legato.io/u/Maroua)\
**Post date:** [September 23, 2019, 12:10pm UTC](https://forum.legato.io/t/data-connect-fails-due-to-missing-dns/4720/10 "2019-09-23T12:10:59Z")

</div>

Thank you for your quick comment @fdu  
I obtained:  
+CREG: 2,3

---

<div class="post-metadata">

**Author:** ![fdu](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/fdu/32/811_2.png) [@fdu](https://forum.legato.io/u/fdu)\
**Post date:** [September 23, 2019, 12:27pm UTC](https://forum.legato.io/t/data-connect-fails-due-to-missing-dns/4720/11 "2019-09-23T12:27:36Z")

</div>

Mhh your device seems to be rejected by the network.  
Can you check your APN setting in +CGDCONT command ?

---

<div class="post-metadata">

**Author:** ![Maroua](https://avatars.discourse-cdn.com/v4/letter/m/839c29/32.png) [@Maroua](https://forum.legato.io/u/Maroua)\
**Post date:** [September 23, 2019, 12:34pm UTC](https://forum.legato.io/t/data-connect-fails-due-to-missing-dns/4720/12 "2019-09-23T12:34:58Z")

</div>

So the Following pdp context is the Following:  
+CGDCONT: 1,“IP”,“APN”,“0.0.0.0”,0,0,0,0  
and the APN is correctly set.  
What would make the device rejected by the network ?

---

<div class="post-metadata">

**Author:** ![fdu](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/fdu/32/811_2.png) [@fdu](https://forum.legato.io/u/fdu)\
**Post date:** [September 23, 2019, 12:46pm UTC](https://forum.legato.io/t/data-connect-fails-due-to-missing-dns/4720/13 "2019-09-23T12:46:34Z")

</div>

Are you sure that APN is the APN related to your SIM card ?  
Can you send me the response to “AT+CIMI” command please ?

---

<div class="post-metadata">

**Author:** ![Maroua](https://avatars.discourse-cdn.com/v4/letter/m/839c29/32.png) [@Maroua](https://forum.legato.io/u/Maroua)\
**Post date:** [September 23, 2019, 12:59pm UTC](https://forum.legato.io/t/data-connect-fails-due-to-missing-dns/4720/14 "2019-09-23T12:59:24Z")

</div>

yes I’m sure about the APN. As for the command it successfully returns the IMSI.

---

<div class="post-metadata">

**Author:** ![plu](https://avatars.discourse-cdn.com/v4/letter/p/e19b73/32.png) [@plu](https://forum.legato.io/u/plu)\
**Post date:** [October 3, 2019, 9:07am UTC](https://forum.legato.io/t/data-connect-fails-due-to-missing-dns/4720/15 "2019-10-03T09:07:31Z")

</div>

hi @Maroua,  
as indicated by fdu, your device is rejected by the network.  
usually it means there is a mismatch between the APN allowed by the network and SIM and the one set into the device ( ie at+cgdcont)  
can you double check the following:  
at!gstatus?  
at+cops=?  
at+cgdcont?

cm SIM info  
cm radio info  
cm data info  
in order to check every settings .

Best Regards,
