The host is not able to store DNS IPs on the ESXi host as the DNS information are removed after a host reboot.
Also the /etc/resolv.conf file is wiped out post reboot.
VMware vSphere ESXi 8.x
Adding the DNS servers before the host reboot was not successful
To use manual DNS configuration, please ensure the DNS IPs are added explicitly via the vCenter UI and then verify /etc/resolv.conf before rebooting the host.
Set-ExecutionPolicy RemoteSigned -Scope CurrentUserConnect-VIServer -Server 10.161.195.52 -User [email protected] -Password SQESuq6vbN.7lJ_f$vmhost = Get-VMHost -Name "10.192.69.167"Get-VMHostNetwork -VMHost $vmhost | Set-VMHostNetwork -DnsFromDhcp $false -Confirm:$falseGet-VMHostNetwork -VMHost $vmhost | Set-VMHostNetwork -SearchDomain "corp.local" -Confirm:$false | Out-NullSet-VMHostNetwork : 6/25/2025 6:27:19 PM Set-VMHostNetwork You can specify the DnsAddress or SearchDomain parameters only if the DnsFromDhcp parameter is set to $false.Get-VMHostNetwork -VMHost $vmhost | Set-VMHostNetwork -SearchDomain "corp.local" -Confirm:$false | Out-NullGet-VMHostNetwork -VMHost $vmhost | Set-VMHostNetwork -DNSAddress "192.168.10.11", "192.168.10.12" -Confirm:$false | Out-Null