Why Does a Container in a CCE Cluster Fail to Perform DNS Resolution?
Symptom
A customer bound its domain name to the private domain names in the DNS service of HUAWEI CLOUD and also to a specific VPC. It is found that the ECSs in the VPC can properly resolve the private domain name but the containers in the VPC cannot.
Application Scenario
Containers in a VPC cannot resolve domain names.
Solution
According to the resolution rules of private domain names, the subnet DNS in the VPC must be set to HUAWEI CLOUD DNS. You can find the details of the private network DNS service on its console.

The customer can perform domain name resolution on the ECSs in the VPC subnet, which indicates that the preceding configuration has been completed in the subnet.

However, when the domain name resolution is performed in a container, the message "bad address" is displayed, indicating that the domain name cannot be resolved.

Check method: Check whether the coredns add-on is installed and running properly. When you purchase a cluster on CCE, coredns will be installed in step 3 Install Add-on.

Log in to the CCE console. In the navigation pane, choose Add-ons. Click the Add-on Instance tab, and view the add-ons installed for the cluster.
It is found that the coredns add-on does not exist in the add-on list. The possible cause is that the coredns add-on was incorrectly uninstalled.

Click the Add-on Marketplace tab, and install the coredns add-on.

Wait until the coredns add-on is installed and running.

On the Parameters tab page, edit advanced settings and add the corresponding domain name and DNS service address. Try to perform domain name resolution in the container again.

Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.