You can modify the /etc/resolv.conf file in the Linux operating system to configure a custom DNS server. You can also use the Serverless App Engine (SAE) console to configure the required settings in a ConfigMap, and then mount the ConfigMap to the /etc/resolv.conf file of a container. This topic describes how to configure a custom DNS server in the SAE console.
Scenarios
The following sample code shows the default configurations of the DNS server in SAE:
cat /etc/resolv.conf
nameserver 100.100.X.XXX
nameserver 100.100.X.XXX
Procedure
Log on to the SAE console.
In the left-side navigation pane, click Namespaces. In the top navigation bar, select a region. Then, click the name of a namespace.
In the left-side navigation pane, click ConfigMaps. On the ConfigMaps page, click Create.
In the Create ConfigMap panel, set the Method parameter to Manual and configure the other parameters. Then, click OK. The following table describes the parameters.
Parameter
Description
Parameter
Description
Method
Manual: In this example, this option is selected.
File: For more information, see Manage a Kubernetes ConfigMap.
ConfigMap Name
Enter a custom name.
ConfigMap Description
Enter a custom description.
Configure Mappings
Key: Enter
resolve.conf
.Value: Enter the content of the
resolv.conf
file.nameserver 100.100.X.XXX nameserver 100.100.X.XXX nameserver 10.0.X.XX
On the Deploy Application page, mount the ConfigMap to the /etc/resolv.conf file.
For more information, see Procedure.
Go to the container by using the webshell, view the /etc/resolv.conf file, and check whether the file content is displayed as expected.
For more information, see Use the webshell feature to check the health status of applications.
In the Webshell window, run the following command to view the file:
cat /etc/resolv.conf
Expected output:
nameserver 100.100.X.XXX nameserver 100.100.X.XXX nameserver 10.0.X.XX