Skip to main content

Your submission was sent successfully! Close

Thank you for signing up for our newsletter!
In these regular emails you will find the latest updates from Canonical and upcoming events where you can meet our team.Close

Thank you for contacting us. A member of our team will be in touch shortly. Close

An error occurred while submitting your form. Please try again or file a bug report. Close

Add-on dns

1.12
Compatibility: amd64 arm64 power s390 strict classic
Source: CoreDNS

This deploys CoreDNS to supply address resolution services to
Kubernetes.

This service is commonly required by other addons, so it is
recommended that you enable it.

microk8s enable dns

By default it forwards requests to the system-defined servers in /etc/resolv.conf for resolving
addresses. This can be changed when you enable the addon, for example:

microk8s enable dns:1.1.1.1

(for multiple DNS addresses, a comma-separated list should be used)

The forward dns servers can also be altered after enabling the addon
by running the command:

microk8s kubectl -n kube-system edit configmap/coredns

This will invoke the vim editor so that you can alter the configuration.

Note: You can set a different default editor by setting the KUBE_EDITOR environment variable. E.g. export KUBE_EDITOR="/usr/bin/nano"

The addon can be disabled at any time:

microk8s disable dns

…but bear in mind this could have implications for services and pods which
may be relying on it.

Last updated 2 years ago. Help improve this document in the forum.