Join Nostr
2026-02-02 11:16:05 UTC

Xerz 💗 on Nostr: so for instance, within an admin Powershell, here's how you'd add the ...

so for instance, within an admin Powershell, here's how you'd add the Mozilla-Cloudflare DNS to Windows:

```pwsh
Add-DnsClientDohServerAddress -ServerAddress '2a06:98c1:52::4' -DohTemplate 'https://mozilla.cloudflare-dns.com/dns-query'; -AllowFallbackToUdp $False -AutoUpgrade $True
Add-DnsClientDohServerAddress -ServerAddress '2803:f800:53::4' -DohTemplate 'https://mozilla.cloudflare-dns.com/dns-query'; -AllowFallbackToUdp $False -AutoUpgrade $True
Add-DnsClientDohServerAddress -ServerAddress '162.159.61.4' -DohTemplate 'https://mozilla.cloudflare-dns.com/dns-query'; -AllowFallbackToUdp $False -AutoUpgrade $True
Add-DnsClientDohServerAddress -ServerAddress '172.64.41.4' -DohTemplate 'https://mozilla.cloudflare-dns.com/dns-query'; -AllowFallbackToUdp $False -AutoUpgrade $True
```

here's how you would apply it to all networks:

```pwsh
foreach ($i in (Get-NetIPInterface -AddressFamily IPv6).InterfaceIndex) { Set-DnsClientServerAddress -InterfaceIndex $i -ServerAddresses ('2a06:98c1:52::4', '2803:f800:53::4') }
foreach ($i in (Get-NetIPInterface -AddressFamily IPv4).InterfaceIndex) { Set-DnsClientServerAddress -InterfaceIndex $i -ServerAddresses ('162.159.61.4', '172.64.41.4') }
```

and here's how you would enforce it:

```pwsh
if (!(Test-Path -Path Registry::'HKLM\Software\Policies\Microsoft\Windows NT\DNSClient')) { New-Item –Path Registry::'HKLM\Software\Policies\Microsoft\Windows NT\' –Name DNSClient }
Set-ItemProperty -Path Registry::'HKLM\Software\Policies\Microsoft\Windows NT\DNSClient\' -Name DoHPolicy -Value 3 -Type DWord -Force
```