Troubleshooting OpenShift Container Platform 4.x: DNS

Solution Verified - Updated -


  • Red Hat OpenShift Container Platform 4.x


  • How to troubleshoot DNS issues in RHCOS 4.x?

Diagnostic Steps

1. Check the cluster operator to see if it is available:

# oc get clusteroperator dns

2. Check to see if there are pods and services created under openshift-dns-operator

# oc get all  -n openshift-dns-operator

3. Check the logs of dns-operator pod

# oc logs pod/`oc get pods -o=jsonpath="{.items[0]}" -n openshift-dns-operator` -n openshift-dns-operator

4. Check dns components are running under openshift-dns project:

# oc get all  -n openshift-dns

5. Check the pod resolver is pointing to DNS Service IP:

# export PODS=`oc get pods -o=jsonpath="{.items[*]}" -n openshift-apiserver`
# for pod in $PODS;do oc exec $pod -n openshift-apiserver -- cat /etc/resolv.conf ;done;

6. You can check coredns container logs on node:

# export PODS=`oc get pods -o=jsonpath="{.items[*]}" -n openshift-dns`
# for pod in $PODS;do oc logs $pod -c dns -n openshift-dns &> $pod.log;done;

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.