Domain Name System (DNS) resolution is one of the methods used for Service discovery in an Alibaba Cloud Container Compute Service (ACS) cluster. This topic describes how DNS resolution works in ACS clusters and the DNS-based Service discovery components supported by ACS clusters.
Usage notes
If you do not enable a DNS-based Service discovery component when you create an ACS cluster, the pods in the cluster use the DNS servers provided by Virtual Private Cloud (VPC) to resolve domain names. In this case, the domain names of Services in the cluster cannot be resolved.
If you enable a DNS-based Service discovery component for an existing ACS cluster, the existing pods in the cluster cannot use the component. You need to recreate the existing pods so that they can use the DNS-based Service discovery component.
How DNS resolution works in ACS clusters
The following code block shows the default content of the /etc/resolv.conf
file when you create a pod in an ACS cluster. The file specifies the DNS server, the search domain, 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.