Skip to main content
Version: 3.18 (latest)

Use NodeLocal DNSCache in your cluster

Big picture

Set up NodeLocal DNSCache to improve DNS lookup latency.

Before you begin


Follow these steps to enable NodeLocal DNSCache connectivity.


  • OpenShift

NodeLocal DNSCache does not support OpenShift. Openshift has its own DNS caching mechanism which deploys CoreDNS pods as DaemonSets. For more information, see Openshift DNS setup.


This how-to guide uses the following Calico features:

  • GlobalNetworkPolicies

Create a policy to allow traffic from NodeLocal DNSCache

The following is a sample network policy that allows all incoming TCP traffic (including incoming traffic from node-local-dns pods) on port 53 on kube-dns.

kind: NetworkPolicy
name: default.local-dns-to-core-dns
namespace: kube-system
tier: default
selector: k8s-app == "kube-dns"
- action: Allow
protocol: TCP
selector: k8s-app == "kube-dns"
- '53'
- Ingress

To refine the sources permitted by this policy, take into account that NodeLocal DNSCache pods are host networked, and make sure to allow traffic from the addresses of your hosts. If you're using encapsulation, you will need to allow connectivity from the tunnel IPs.

The Tigera operator creates policy to allow Tigera components to connect to NodeLocal DNSCache when detected. Felix accounts for the NodeLocal DNSCache in creating DNS Logs and enforcing DNS Policy.