Help Center> Cloud Container Engine> FAQ> DNS FAQs> What Should I Do If Domain Name Resolution Fails?

What Should I Do If Domain Name Resolution Fails?

Check Item 1: Whether the coredns Add-on Has Been Installed

  1. Log in to the CCE console.
  2. In the navigation pane on the left, choose Add-ons. On the Add-on Instance tab page, check whether the coredns add-on has been installed.
  3. If not, install the add-on. For details, see Why Does a Container in a CCE Cluster Fail to Perform DNS Resolution?.

Check Item 2: Whether the coredns Instance Reaches the Performance Limit

  1. Log in to the CCE console.
  2. In the navigation pane on the left, choose Add-ons. On the Add-on Instance tab page, locate the coredns add-on of the cluster.
  3. Click the coredns add-on name to check whether the add-on is in the Running state.
  4. On the Resources tab page, click Monitoring at the row of a pod to check whether the performance bottleneck has been reached. If the resource usage is too high, modify the concurrency performance of the coredns add-on on the Parameters tab page.

Check Item 3: Whether the External Domain Name Resolution Is Slow or Times Out

If the domain name resolution failure rate is lower than 1/10000, optimize parameters by referring to How Do I Optimize the Configuration If the External Domain Name Resolution Is Slow or Times Out? or add a retry policy in the service.

Check Item 4: Whether UnknownHostException Occurs

When service requests in the cluster are sent to an external DNS server, a domain name resolution error occurs due to occasional UnknownHostException.

Introduction

UnknownHostException is a common exception. When this exception occurs, check whether there is any domain name-related error or whether you have entered a correct domain name.

  • Check the host name carefully (spelling and extra spaces).
  • Check the DNS settings. Before running the application, run the ping hostname command to ensure that the DNS server is started and running. If the host name is new, you need to wait for a period of time before the DNS server is accessed.

If the host name and DNS settings are correct, you can use the following optimization policies.

Optimization policies:

  1. Change the coredns cache time.
  2. Configure the stub domain.
  3. Modify the value of ndots.
  • Increasing the cache time of coredns helps resolve the same domain name for the N time, reducing the number of cascading DNS requests.
  • Configuring the stub domain can reduce the number of DNS request links.

How to modify:

  1. Modifying the coredns cache time and configuring the stub domain:

    Configuring the Stub Domain for CoreDNS

    Restart the coredns add-on after you modify the configurations.

  2. Modifying ndots:

    How Do I Optimize the Configuration If the External Domain Name Resolution Is Slow or Times Out?

    Example:

          dnsConfig:
            options:
              - name: timeout
                value: '2'
              - name: ndots
                value: '5'
              - name: single-request-reopen

    You are advised to change the value of ndots to 2.