Configuring Verbose Logging for CoreDNS
search cancel

Configuring Verbose Logging for CoreDNS

book

Article ID: 424092

calendar_today

Updated On:

Products

Tanzu Kubernetes Runtime

Issue/Introduction

This article provides the steps to enable logging within CoreDNS pods to assist in diagnosing and troubleshooting DNS resolution issues within the cluster.

Environment

vSphere Kubernetes Service

Resolution

By default, the CoreDNS corefile does not have the log directive enabled, so CoreDNS will not show DNS queries. To enable logging, edit the CoreDNS ConfigMap as follows: 

Edit the CoreDNS ConfigMap: kubectl -n kube-system edit configmap coredns

Inside the Corefile block, add the keyword 'log', right after this line:
.:53 {

So it becomes:
 .:53 {
      log
      errors
      health { lameduck 5s }
      ready
      ...
}