asked on
Set-DhcpServerv4OptionValue -ComputerName "srv1234.blah.net" ,-ScopeID, 123.45.6.0, etc -DnsServer 123.456.789.1, etc
Set-DhcpServerv4OptionValue -ComputerName "srv1234.blah.net" -DnsServer 123.456.789.1
ASKER
Set-DhcpServerv4OptionValue -ComputerName $NextComputer -DnsServer 123.456.789.1
ASKER
ASKER
ASKER
ASKER
$MyServerList = Get-Content -Path C:\My_SERVER_LIST.txt
foreach ($server in $MyServerList)
{
Get-DhcpServerv4Scope -ComputerName $server | Where-Object { $_.Name -notlike 'MY_EXCLUDED_VLAN' } | Set-DhcpServerv4OptionValue -ComputerName $server -DnsServer 123.456.789.0, etc
}
The Domain Name System (DNS) is a hierarchical, globally distributed system responsible for associating the name of a computer, service or other resource into an IP address for connecting to the Internet or a private network. Most prominently, it translates domain names to the numerical IP addresses needed for the purpose of computer services and devices worldwide.
TRUSTED BY
Pro tip. I don't set DNS on a per scope basis in general. It is set per server.
Second pro tip. Don't ever change your DNS servers. I use the same IP addresses in 2020 as I did in 2005 for my DNS servers. Of course my DNS servers have been replaced many times, but I keep using the same IP addresses. I am also looking at possibly moving them behind a load balancer, but then the load balancer will take the IP address.
I am not a powershell expert either.