From e4cae73dd7a73d9c51e5a4fc83f9cc9382c7a649 Mon Sep 17 00:00:00 2001 From: bschaper Date: Thu, 30 Jan 2025 13:01:46 -0600 Subject: [PATCH] Added setting dns, but will not use it --- Patches/Windows/Set-Custom-DNS.ps1 | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 Patches/Windows/Set-Custom-DNS.ps1 diff --git a/Patches/Windows/Set-Custom-DNS.ps1 b/Patches/Windows/Set-Custom-DNS.ps1 new file mode 100644 index 0000000..3d2cdb8 --- /dev/null +++ b/Patches/Windows/Set-Custom-DNS.ps1 @@ -0,0 +1,26 @@ +# NOT IN USE +# Define the Adguard DNS server addresses +$PrimaryDNS = "94.140.14.15" +$SecondaryDNS = "94.140.15.16" + +# Get the interface index of Ethernet adapter +$EthernetInterfaceIndex = (Get-NetAdapter | Where-Object {$_.Name -like "*Ethernet*" }).InterfaceIndex + +# Get the interface index of Wi-Fi adapter +$WiFiInterfaceIndex = (Get-NetAdapter | Where-Object {$_.Name -like "*Wi-Fi*" }).InterfaceIndex + +# Check if Ethernet interface exists +if ($EthernetInterfaceIndex) { + Set-DNSClientServerAddress -InterfaceIndex $EthernetInterfaceIndex -ServerAddresses @($PrimaryDNS, $SecondaryDNS) + Write-Host "DNS servers set for Ethernet adapter." +} else { + Write-Warning "Ethernet adapter not found." +} + +# Check if Wi-Fi interface exists +if ($WiFiInterfaceIndex) { + Set-DNSClientServerAddress -InterfaceIndex $WiFiInterfaceIndex -ServerAddresses @($PrimaryDNS, $SecondaryDNS) + Write-Host "DNS servers set for Wi-Fi adapter." +} else { + Write-Warning "Wi-Fi adapter not found." +}