Configure a custom DNS server

Updated at: 2024-09-03 00:02

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

  1. Log on to the SAE console.

  2. In the left-side navigation pane, click Namespaces. In the top navigation bar, select a region. Then, click the name of a namespace.

  3. In the left-side navigation pane, click ConfigMaps. On the ConfigMaps page, click Create.

  4. 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. sc_create_config_DNS

    Parameter

    Description

    Parameter

    Description

    Method

    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
  5. On the Deploy Application page, mount the ConfigMap to the /etc/resolv.conf file.

    For more information, see Procedure. sc_config_management_DNS

  6. Go to the container by using the webshell, view the /etc/resolv.conf file, and check whether the file content is displayed as expected.

    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
  • On this page (1, T)
  • Scenarios
  • Procedure
Feedback
phone Contact Us

Chat now with Alibaba Cloud Customer Service to assist you in finding the right products and services to meet your needs.

alicare alicarealicarealicare