forked from shoober420/windows11-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDNS.ps1
More file actions
10 lines (9 loc) · 741 Bytes
/
DNS.ps1
File metadata and controls
10 lines (9 loc) · 741 Bytes
1
2
3
4
5
6
7
8
9
10
# Set DNS servers to Cloudflare 1.1.1.1 and use encrypted DoH
$i = Get-NetAdapter -Physical
$i | Get-DnsClientServerAddress -AddressFamily IPv4 | Set-DnsClientServerAddress -ServerAddresses '1.1.1.1', '1.0.0.1'
$i | ForEach-Object {
$s1 = 'HKLM:System\CurrentControlSet\Services\Dnscache\InterfaceSpecificParameters\' + $_.InterfaceGuid + '\DohInterfaceSettings\Doh\1.1.1.1'; New-Item -Path $s1 -Force | New-ItemProperty -Name "DohFlags" -Value 1 -PropertyType Qword
$s2 = 'HKLM:System\CurrentControlSet\Services\Dnscache\InterfaceSpecificParameters\' + $_.InterfaceGuid + '\DohInterfaceSettings\Doh\1.0.0.1'; New-Item -Path $s2 -Force | New-ItemProperty -Name "DohFlags" -Value 1 -PropertyType Qword
}
Clear-DnsClientCache;
cmd /c 'pause'