The custom domain name system (DNS) feature is suitable for scenarios such as site access acceleration. This topic describes how to configure custom DNS settings for functions in the Function Compute console.
Background information
The resolv.conf file is a system configuration file. After you configure custom DNS settings, the original resolv.conf file is overwritten. You can run the man 5 resolver
command in Linux to query the syntax of the resolv.conf file. If a message indicating that no manual page exists is returned, install a manual page based on your Linux distribution. For more information, see Linux manual page.
Limits
The custom DNS feature supports only the runtimes and custom runtimes that are provided by Function Compute.
Prerequisites
Configure custom DNS settings
Note If you want to use the default DNS servers of Function Compute, enter the 100.100.2.136 and 100.100.2.138 IP addresses in the Name Servers fields.
- Log on to the Function Compute console.
- In the left-side navigation pane, click Services & Functions.
- In the top navigation bar, select a region.
- On the Services page, click the desired service.
- On the Functions page, find the function that you modify and click Configure in the Actions column.
- In the DNS Configuration section, configure the parameters and click Save. The following table describes the parameters.
Parameter Description Example Name Servers The IP addresses of the DNS servers. You can add the IP addresses of one or more DNS servers. - 223.5.5.5
- 223.6.6.6
Search Domain The DNS search domains. You can add one or more search domains. If the accessed domain name cannot be resolved by DNS, the search domain is appended to the domain name, and then the accessed domain name is resolved again. mydomain.com DNS Options The configuration items in the resolv.conf file. Each item corresponds to a key-value pair in the key:value format, in which the key is required. attempts:1 - Verify whether the custom DNS settings that you configured take effect.