question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

pods cant resolve dns from external dns server

See original GitHub issue

Ubuntu Server 22.04 microk8s enable dns

pods can ping ips of the network but cant resolve dns names in the network.

from node host i can resolve external dns correctly.

-- inside pod---

(ping to external dns ip)
# ping 10.58.20.1
PING 10.58.20.1 (10.58.20.1) 56(84) bytes of data.
64 bytes from 10.58.20.1: icmp_seq=1 ttl=127 time=0.487 ms

(ping to external dns name)
# ping dc01
ping: dc01: Name or service not known

# ping dc01.lab.local
ping: dc01: Name or service not known

# cat /etc/resolv.conf
search app.svc.cluster.local svc.cluster.local cluster.local lab.local
nameserver 10.152.183.10
options ndots:5
root@app-api-6d7f865754-9zcdg:/opt/app/api#

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
agonzalezmcommented, May 28, 2022

I tested this in Ubuntu Server 20.04.4 and no problem i can run apt-get update from my container and resolve correctly with my pods, looks like problem in 22.04 not mature enough

0reactions
olamycommented, Oct 23, 2022

microk8s disable dns export dnss=cat /run/systemd/resolve/resolv.conf | grep nameserver | cut -d ' ' -f2 microk8s enable dns:$dnss

I did that for sure. But then:

microk8s kubectl run -i --tty --rm debug --image=busybox --restart=Never -- sh
If you don't see a command prompt, try pressing enter.
/ # nslookup github.com
Server:		10.152.183.10
Address:	10.152.183.10:53

Non-authoritative answer:

*** Can't find github.com: No answer

But more interesting my dns server is 10.0.0.1.

/ # nslookup github.com 10.0.0.1
Server:		10.0.0.1
Address:	10.0.0.1:53

Non-authoritative answer:
Name:	github.com
Address: 140.82.114.3

*** Can't find github.com: No answer
Read more comments on GitHub >

github_iconTop Results From Across the Web

Resolving external domains from within pods does not work
It's only from within the pods that the resolution is failing meaning I cannot communicate with the Internet from within the pods. This...
Read more >
Pods can not resolve hostname from external DNS server
I have dns server on my local network and ingresses are resolved from this server. The problem is pods work inconsistent. Sometimes they...
Read more >
Debugging DNS Resolution - Kubernetes
Create a simple Pod to use as a test environment · Check the local DNS configuration first · Check if the DNS pod...
Read more >
DNS Failures on Kubernetes – Runbooks - GitHub Pages
If the issue is happening on all pods, there is a chance all the pods have incorrect DNS config, so this may also...
Read more >
Troubleshoot DNS failures with Amazon EKS - AWS
Resolution · Verify that the kube-proxy pod is working · Connect to the application pod to troubleshoot the DNS issue · Get more...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found