NGINX in Openshift - NGINX can't resolve internal hostnames NGINX in Openshift - NGINX can't resolve internal hostnames nginx nginx

NGINX in Openshift - NGINX can't resolve internal hostnames


Running ngnix in OpenShift 4.7 I was able to work around this issue by adding

resolver dns-default.openshift-dns.svc.cluster.local

to the server configuration. Apparently, ngnix is not parsing /etc/resolv.conf, but (in my case), dns-default.openshift-dns.svc.cluster.local also resolves to 172.30.0.10, which was defined as a nameserver in /etc/resolv.conf.


In Openshift cluster there is SkyDNS service on each master node. It normally listens on port 8053. Just use them as the resolver for nginx config and you will be fine:

resolver your-openshift-master-node1-ip:8053 your-openshift-master-node2-ip:8053;