Skip to content

Commit

Permalink
add custom script sample
Browse files Browse the repository at this point in the history
  • Loading branch information
nick-ms-ts committed Jun 19, 2024
1 parent 7002d80 commit cd305c3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
powershell ./setupdnsserver.ps1 "'168.63.129.16'"
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
$CustomDNSServers = $args[0]

$ips = Get-NetIPAddress -AddressFamily IPv4
for ($i = 0; $i -lt $ips.Count; $i++)
{
$ip = $ips[$i]
if ($ip.IPAddress -ne "127.0.0.1" -and (-not $ip.IPAddress.StartsWith("169.254")))
{
Set-DnsClientServerAddress -InterfaceIndex $ip.InterfaceIndex -ServerAddresses $CustomDNSServers.Split(" ")
}
}

0 comments on commit cd305c3

Please sign in to comment.