Changing the DNS server configuration on appliances

Complete this task only if you must change the DNS addresses after the initial boot of the VM.

Before you begin

Verify that you have VMware console access to the VM, as well as the correct password. If you cannot ssh into the appliance, you can use the VMware console interactive login instead (use the apicadm login and the password configured as default-password in the apicup project).

About this task

This task is only valid for making changes to DNS resolution. The IP address of the VM cannot be changed at any time after the initial boot.

Procedure

  1. Edit the /etc/netplan/50-cloud-init.yaml file and update the list of nameserver addresses.
    Attention: Typically, you do not edit this file manually. You should only make direct changes to the /etc/netplan/50-cloud-init.yaml file when you need to update the nameserver addresses.

    The following example shows what the list of nameserver addresses looks like in the file:

    network:
        ethernets:
            eth0:
                addresses:
                - 192.168.122.242/24
                nameservers:
                    addresses:
                    - 1.1.1.1
                    - 1.0.0.1
                    - 8.8.8.8
                    search:
                    - nip.io
                routes:
                -   metric: 10
                    to: 0.0.0.0/0
                    via: 192.168.122.1
        version: 2
    
  2. Run the following command to apply the changes:
    sudo netplan apply
  3. Run the following command to verify the changes:
    cat /run/systemd/resolve/resolv.conf
  4. Attach an updated ISO to the VM to ensure all artifacts are up-to-date in case a disaster recovery is needed.
    1. Update the apicup project configuration with the correct DNS values.
    2. Generate a new ISO based on the updated project.
    3. Attach the new ISO to the VM.