Configuring Local Domain Name Mapping

The local domain name mapping is necessary for a third-party image repository, if the server address of the third-party image repository provided by the user is a domain name instead of an IP address. For details about how to use a third-party image repository, see Configuration APIs.

  • If you do not need to use a third-party image repository to obtain containerized application images or the server address of the third-party image repository is an IP address, you do not need to configure this API.
  • The mapping between domain names and IP addresses is stored in the /etc/hosts file. A maximum of 16 domain name mappings can be configured using MEF Edge. If you configure the same domain name repeatedly, the configured IP address with the corresponding domain name will be overwritten.
  • To delete the local domain name mapping, open the /etc/hosts file as the root user in the background and delete the unnecessary domain name mapping.
  1. Log in to the device environment as the root user.
  2. Run the following command to switch to the directory where run.sh is located:
    cd Installation_path/MEFEdge/software/
  3. Run the following command to configure the local domain name mapping:
    ./run.sh domainconfig --ip=<Actual IP address of the third-party image repository> --domain=<Domain name of the third-party image repository>
    Table 1 domainconfig parameters

    Parameter

    Description

    ip

    Actual IP address of the third-party image repository that can be accessed. Only IPv4 is supported. It cannot be an all-0 address (0.0.0.0), a broadcast address (255.255.255.255), or a loopback address (127.0.0.1).

    domain

    Domain name of a third-party image repository. The value can contain 3 to 63 characters, including uppercase letters, lowercase letters, digits, and special characters (.-). It must start and end with a letter or digit, but it cannot contain only digits.

    NOTE:

    The domain name of a third-party image repository cannot be localhost or other domain names equivalent to localhost.