# DNS not resolving inside a pod

**URL:** <https://discuss.kubernetes.io/t/dns-not-resolving-inside-a-pod/14812>\
**Category:** microk8s\
**Created:** [February 13, 2021, 1:11am UTC](https://discuss.kubernetes.io/t/dns-not-resolving-inside-a-pod/14812 "2021-02-13T01:11:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Doc\_Rob](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/doc_rob/32/6957_2.png) [@Doc\_Rob](https://discuss.kubernetes.io/u/Doc_Rob)\
**Post date:** [February 13, 2021, 1:11am UTC](https://discuss.kubernetes.io/t/dns-not-resolving-inside-a-pod/14812/1 "2021-02-13T01:11:47Z")

</div>

Hi there,  
I installed my first microk8s cluster and need help trying to figure out what I did wrong.  
I can deploy pods no problem and they run just fine until they need to access an external address via DNS name. I can ping the sites by IP address, but not by DNS name.  
For example:  
root@my-shell2:/# ping dns.google  
ping: unknown host dns.google

```
root@my-shell2:/# ping 8.8.4.4
PING 8.8.4.4 (8.8.4.4) 56(84) bytes of data.
64 bytes from 8.8.4.4: icmp_seq=1 ttl=116 time=11.3 ms
64 bytes from 8.8.4.4: icmp_seq=2 ttl=116 time=11.2 ms
64 bytes from 8.8.4.4: icmp_seq=3 ttl=116 time=11.3 ms
64 bytes from 8.8.4.4: icmp_seq=4 ttl=116 time=11.1 ms

```

nslookup inside the pod yields this:  
root@my-shell2:/# nslookup dns.google  
Server: 10.152.183.10  
Address: 10.152.183.10#53

```
** server can't find dns.google: SERVFAIL

```

10.152.183.10 corresponds to the Cluster-IP for the kube-dns service

And when I try to ping 10.152.183.10 from within the pod, I get this:  
root@my-shell2:/# ping 10.152.183.10  
PING 10.152.183.10 (10.152.183.10) 56(84) bytes of data.  
From 10.253.253.253 icmp\_seq=98 Destination Net Unreachable  
From 10.253.253.253 icmp\_seq=116 Destination Net Unreachable  
From 10.253.253.253 icmp\_seq=148 Destination Net Unreachable

(that From address looks really strange)

One thing to note is that I originally set this microk8s box up in my home connected to my personal router and was also running OpenVPN on the same microk8s box. Since then, I moved the microk8s box to my school behind it’s VPN and I removed OpenVPN. This also changed its IP address pool (which I manually changed in the microk8s configuration, although I cannot remember offhand where I did that).

Thank you for any help you can offer!

---

<div class="post-metadata">

**Author:** ![Bipin\_Pandey](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/bipin_pandey/32/6974_2.png) [@Bipin\_Pandey](https://discuss.kubernetes.io/u/Bipin_Pandey)\
**Post date:** [February 16, 2021, 3:20am UTC](https://discuss.kubernetes.io/t/dns-not-resolving-inside-a-pod/14812/2 "2021-02-16T03:20:34Z")

</div>

Hi Rob,  
Microk8s enable DNS  
you can add DNS IP below the location  
**vi /var/snap/microk8s/current/args/kubelet**  
add cluster DNS IP(10…x.x.x;8.8.8.8;8.8.4.4) google IP  
After add dns down and up you pods to reflect ip dns in pods.
