Enabling Host DNS
Use the following machine configuration patch to enable host DNS resolver:enabled: false
as well.
Operations
When enabled, Talos Linux starts a DNS caching server on the host, listening on address127.0.0.53:53
(both TCP and UDP protocols).
The host /etc/resolv.conf
file is rewritten to point to the host DNS server:
Forwarding kube-dns
to Host DNS
Note: This feature is enabled by default for new clusters created with Talos 1.8.0 and later.When host DNS is enabled, by default,
kube-dns
service (CoreDNS
in Kubernetes) uses host DNS server to resolve external names.
This way the cache is shared between the host DNS and kube-dns
.
Talos allows forwarding kube-dns
to the host DNS resolver to be disabled with:
coredns
pods in Kubernetes to pick up changes.
When forwardKubeDNSToHost
is enabled, Talos Linux allocates IP address 169.254.116.108
for the host DNS server, and kube-dns
service is configured to use this IP address as the upstream DNS server:
This way kube-dns
service forwards all DNS requests to the host DNS server, and the cache is shared between the host and kube-dns
.
Resolving Talos Cluster Member Names
Host DNS can be configured to resolve Talos cluster member names to IP addresses, so that the host can communicate with the cluster members by name. Sometimes machine hostnames are already resolvable by the upstream DNS, but this might not always be the case. Enabling the feature:talos-default-worker-1
name will resolve to 127.0.0.3
.
Example usage:
forwardKubeDNSToHost
, kube-dns
service will also resolve Talos cluster member names to IP addresses.