Added setting dns, but will not use it
This commit is contained in:
parent
db38491d7b
commit
e4cae73dd7
26
Patches/Windows/Set-Custom-DNS.ps1
Normal file
26
Patches/Windows/Set-Custom-DNS.ps1
Normal file
@ -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."
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user