The below PowerShell script will Add any IP you like to the Local Windows Host File for name resolving .

#!powershell

# Setup Key Values
###################################
$ServerName = “ad01.knowledgeascent.com’
$IPofServerName = “10.100.200.50”
$file = “C:\Windows\System32\drivers\etc\hosts”
$hostname = $env:computername

# Adding the IP to Local Host File
#####################################

function add-host([string]$filename, [string]$ip, [string]$hostname) {
$IPofServerName + ” ” + $hostname | Out-File -encoding ASCII -append $filename }

write-host ” ”
write-host “Adding $IPofServerName $ServerName to local host name” -ForegroundColor Yellow
write-host ” ”

add-host $file $IPofServerName $ServerName