Changing the DNS Server IP address on an ESXi host:
Method 1: Using vSphere Client (UI)
If the host is managed by vCenter and reachable, log in to the vSphere Client to update DNS settings directly from the UI.
- Log in to the vSphere Client as an administrator (e.g.,
[email protected]). - Navigate to Hosts and Clusters and select the ESXi host.
- Go to the Configure tab.
- Under Networking, select TCP/IP configuration.
- Choose the appropriate TCP/IP stack (usually Default TCP/IP stack).
- Click Edit settings.
- Under DNS Configuration, update the Primary and Alternate DNS servers.
- Click OK to save the configuration.
- 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.
- Log in to the ESXi Direct Console User Interface (DCUI).
- Press F2 on the host console to access Customize System/View Logs.
- Enter the
root credentials. - Navigate to Configure Management Network > DNS Configuration.
- Enter the new Primary and Alternate DNS server IP addresses.
- Press Enter to save.
- Select Restart Management Network to apply the changes.
- Verify the updated DNS configuration under Configure Management Network > Network Adapters or DNS Configuration.
Method 3: Using ESXi Shell or SSH
- Log in to the ESXi host via SSH or the ESXi Shell as the
root user. - View the current DNS configuration:
esxcli network ip dns server list
- Add a new DNS server IP:
esxcli network ip dns server add -s <DNS_IP_Address>
- Remove an existing DNS server IP:
esxcli network ip dns server remove -s <DNS_IP_Address>
- Restart the management services to apply the change:
/etc/init.d/hostd restart && /etc/init.d/vpxa restart
Note:
Ensure the VLAN is correctly configured if the hosts are using VLANs.
The hostname and DNS suffixes can also be configured in the DCUI.