King Zone - ESXCLI
type: channel
link: https://www.kingtam.win/tag/ESXCLI/
items: Renew DNS Servers in VMWare ESXi via ESXCLI Commands

Renew DNS Servers in VMWare ESXi via ESXCLI Commands
type: item
date: 2023-06-02T16:41:59+08:00
description: Renew DNS Servers in VMWare ESXi via ESXCLI Commandsesxi-dns-update.jpgAbout IssueIf you need to renew DNS servers on an ESXi host and are having trouble finding the DNS field in the ESXi portal, you can use ESXCLI commands to update the DNS servers.ProcedureEnable SSH Service first on ESXi2023-06-02_140843.pngOpen a console or SSH session to the ESXi host.ssh root@esxi_ip_addressList Current DNS server IP AddressRun the commandesxcli network ip dns server listDNSServers: 10.1.1.253, 10.1.1.254Add new DNS server IP addressIn this scenario, I use 1.1.1.1 and 1.0.0.1 as the new DNS server address.esxcli network ip dns server add --server=1.1.1.1 esxcli network ip dns server add --server=1.0.0.1Remove the exsiting (old) DNS addressRefer to previous list the DNS address (10.1.1.253, 10.1.1.254)esxcli network ip dns server remove --server=10.1.1.253 esxcli network ip dns server remove --server=10.1.1.254List Current DNS server IP Address after update.esxcli network ip dns server listDNSServers: 1.1.1.1, 1.0.0.1Finally diable SSH Service on ESXi2023-06-02_141137.pngConclusionUsing the ESXCLI commands to update DNS servers is particularly useful when the DNS field is not easily accessible in the ESXi portal, or when there are a large number of ESXi hosts to update.ReferenceVMWare ESXi ESXCLI Commands to Update Host DNS Servers