Domain Name System (DNS) resolution is one of the methods for Service discovery in Alibaba Cloud Container Compute Service (ACS) clusters. ACS supports DNS-based Service discovery components that resolve Service domain names within a cluster.
Usage notes
-
If you do not enable a DNS-based Service discovery component when you create an ACS cluster, pods use the DNS servers provided by Virtual Private Cloud (VPC) to resolve domain names. In this case, Service domain names within the cluster cannot be resolved.
-
If you enable a DNS-based Service discovery component for an existing ACS cluster, existing pods cannot use the component. You must recreate the pods for the component to take effect.
How DNS resolution works in ACS clusters
The following code block shows the default /etc/resolv.conf file for a pod in an ACS cluster. This file specifies the DNS server, search domains, and other parameters.
# The nameserver parameter specifies the IP address of the DNS server that is used by the pod.
nameserver 172.xx.x.xx
# The search parameter specifies the search domain suffixes that are appended to the Service that you want to access. If the pod belongs to the kube-system namespace, the following search domain suffixes are used:
search kube-system.svc.cluster.local svc.cluster.local cluster.local
# Other parameters
options ndots:5
For more information about the DNS configuration file and the DNS policies of pods, see DNS policies and domain name resolution.