DNS problem pod is not resolving

So for starters, I deployed my cluster with the following customizations:

 kube_api:
  service_cluster_ip_range: 172.31.0.0/17
  always_pull_images: false
  pod_security_policy: false
  service_node_port_range: 30000-32767
kube_controller:
  cluster_cidr:  172.31.128.0/17
  service_cluster_ip_range:  172.31.0.0/17
kubelet:
  cluster_domain: cluster.local
  cluster_dns_server:  172.31.0.10
  extra_binds:
    - "/kubernetes:/data"

I have some test pods running in the minio namespace:

minio1-0               0/1     Running   142        12h
minio1-1               0/1     Running   142        12h 
minio1-2               0/1     Running   142        12h
minio1-3               0/1     Running   142        12h

DNS is not resolving:

API: SYSTEM()
Time: 16:30:28 UTC 02/14/2020
Error: lookup minio1-0.minio.default.svc.cluster.local on 172.31.0.10:53: no such host
host=minio1-0.minio.default.svc.cluster.local, elapsedTime=2 minutes elapsed

I created a dns utility pod and ran some tests:

I can resolve the bare metal node:
/ # nslookup IPADDRESS
IPADDRESS.in-addr.arpa name = zz50p01if-07081501.example.com.

I can’t resolve any pods:

/ # nslookup minio1-0.minio1.svc.cluster.local
Server: 172.31.0.10
Address: 172.31.0.10#53

** server can’t find minio1-0.minio1.svc.cluster.local: NXDOMAIN

Thanks for any help. Totally clueless when it comes to Kubernetes and DNS.

3 years and no answer :frowning:

Have you ever solved this? Also stuck with the exact same problem.

What is your service name and namespace? pods should register with the service and you can communicate with them through the service.


apiVersion: v1
kind: Service
metadata:
name: ddns-updater
namespace: default

For example , I have a pod named ddns-updater and a service also called ddns-updater. To access one of the pods, I can resolve ddns-updater.default.svc.cluster.local to find it.

spec:
  ports:
    - protocol: TCP
      port: 8000
      targetPort: 8000
  selector:
    app: ddns-updater