Configuring DNS

Run the cat /etc/resolv.conf command on all target devices to check whether DNS has been configured for the operating system. It is recommended that the DNSs of all target devices be the same.

If the DNS configuration information (such as nameserver) is displayed, DNS has been configured.

If no command output is displayed, DNS is not configured. Perform the following steps to configure DNS:

  1. Query the name of the network port configured with a service IP address.
    ip a
  2. Configure DNS for the corresponding network port. It is recommended that the DNSs of all network ports be the same.
    For example, the network port name queried in step 1 is enp125s0f0.
    nmcli connection modify enp125s0f0 +ipv4.dns 10.10.10.254
    nmcli connection up enp125s0f0
    • 10.10.10.254 is an example of the DNS address.
    • enp125s0f0 is an example of the network port name.
    • The use of the nmcli command to configure DNS is only an example. You need to follow the DNS configuration scheme provided by the specific OS image provider to complete the configuration.
  3. Check whether DNS is successfully configured.
    cat /etc/resolv.conf
    If the following information is displayed, DNS is successfully configured:
    # Generated by NetworkManager
    nameserver 10.10.10.254