How to change ESXi host DNS server IP
search cancel

How to change ESXi host DNS server IP

book

Article ID: 397246

calendar_today

Updated On:

Products

VMware vSphere ESXi

Issue/Introduction

This article provides steps to change the ESXi server's DNS server new IP or replace it with a new IP, or remove the IP.

Environment

ESXi 7.x \ 8.x

Resolution

DNS Server IP change on ESXi host:

 

 

Method 1: Using vSphere Client (UI)

If the host is managed by vCenter and reachable, you can update DNS settings directly from the UI.

  1. Log in to the vSphere Client.
  1. Navigate to:
    Hosts and Clusters → Select the ESXi Host
  2. Go to the Configure tab.
  3. Under Networking, select TCP/IP configuration.
  4. Choose the appropriate TCP/IP stack (usually Default TCP/IP Stack).
  5. Click Edit settings.
  6. Under DNS Configuration, update the Primary and Alternate DNS servers.
  7. Click OK to save the configuration.
  1. Reconnect the host or restart management services if required for the changes to take effect.

--------------------------------------------------------------------------------------------------------------------------------------------------------------
Method 2: Using Direct Console User Interface (DCUI)

This method is useful when the host is not reachable on the network or SSH is disabled.

  1. Log in to the ESXi Direct Console User Interface (DCUI).
    • Press F2 on the host console to access Customize System/View Logs.
  2. Enter the root credentials.
  3. Navigate to:
    Configure Management Network → DNS Configuration
  4. Enter the new Primary and Alternate DNS Server IP addresses.
  5. Press Enter to save.
  6. Select Restart Management Network to apply the changes.
  7. Verify the updated DNS configuration under:
    Configure Management Network → Network Adapters or DNS Configuration

 

--------------------------------------------------------------------------------------------------------------------------------------------------------------

Method 3: Using ESXi Shell / SSH

  1. Log in to the ESXi host via SSH or ESXi Shell.
  2. View the current DNS configuration:
    esxcli network ip dns server list
  3. Add a new DNS server IP:
    esxcli network ip dns server add -s <DNS_IP_Address>
  4. Remove an existing DNS server IP:
    esxcli network ip dns server remove -s <DNS_IP_Address>
  5. Restart the management services to apply the change:
    /etc/init.d/hostd restart && /etc/init.d/vpxa restart


Note:

If the ESXi host is part of a vSphere Distributed Switch (vDS), it may need to be re-added to the distributed switch after the management network reconfiguration.

Additional Information

  • Ensure the VLAN is correctly configured if you are using VLANs.
  • You can also configure the hostname and DNS suffixes in the DCUI.