DEV Community

Mohamed Hamdi
Mohamed Hamdi

Posted on

Integrating OpenShift CoreDNS with Active Directory DNS

Integrating OpenShift CoreDNS with Active Directory (AD) enables your OpenShift cluster to resolve DNS records from your AD-managed domain. This article walks through the steps to configure CoreDNS to forward DNS queries to your AD DNS server.

Prerequisites

  • OpenShift cluster with CoreDNS.
  • Active Directory DNS server (e.g., 192.168.1.10 for domain example.local).
  • OpenShift nodes must be able to reach the AD DNS server.

Steps to Configure CoreDNS for AD Integration

  • Edit the CoreDNS ConfigMap
oc edit configmap coredns -n openshift-dns
Enter fullscreen mode Exit fullscreen mode
  • Modify the CoreDNS ConfigFile
. {
  forward . 8.8.8.8 8.8.4.4     # External DNS (Google DNS)
  forward . 192.168.1.10       # AD DNS server
  cache 300                    # Cache TTL for external queries (5 minutes)
  log                          # Enable logging
  metrics                      # Enable Prometheus metrics
  health                       # Enable health check
}

example.local:53 {
  forward . 192.168.1.10       # Forward queries for example.local to AD DNS
  cache 600                    # Cache TTL for AD domain queries (10 minutes)
  log                          # Log queries for example.local
}
Enter fullscreen mode Exit fullscreen mode
  • Apply the Configuration
oc delete pod -n openshift-dns --all
Enter fullscreen mode Exit fullscreen mode
  • Test DNS Resolution
oc run -i --tty --rm debug --image=busybox --restart=Never -- nslookup myhost.example.local
Enter fullscreen mode Exit fullscreen mode
  • Monitor and Troubleshoot
oc logs -n openshift-dns <coredns-pod-name>

curl http://<coredns-pod-ip>:9180/health

Metrics: Monitor DNS metrics via Prometheus
Enter fullscreen mode Exit fullscreen mode

Conclusion

By configuring CoreDNS to forward DNS queries to your AD DNS server, you enable your OpenShift cluster to resolve AD-managed domain records. With CoreDNS's caching, logging, metrics, and health checks, you can optimize DNS resolution and ensure a reliable DNS setup.

Top comments (0)