One-Button / Automated Encrypted DNS (ODoH) Example On Windows 10 / 11

Regular Contributor

Note: This stub resolver example utilizes ODoH (DNSCrypt-Proxy 2.x), can be used in conjunction with a VPN, and an optional Caching-Only DNS / Name Server behind it.

 

NOTE: Right-click on the following batch files after saving them, and click "Run as administrator".

 

(1.) Use Notepad to create this file on your desktop or another folder: DNSCrypt-Proxy_Auto_Installer.bat

 

@ECHO OFF
SETLOCAL EnableDelayedExpansion
MKDIR "%ProgramFiles%\dnscrypt-proxy\backup"
XCOPY "%~f0" "%ProgramFiles%\dnscrypt-proxy\backup\" /C /I /Q /G /H /R /Y /B /J
CD /D "%ProgramFiles%\dnscrypt-proxy"
ECHO Windows Registry Editor Version 5.00> "%ProgramFiles%\dnscrypt-proxy\backup\dns-proxy.reg"
ECHO:>> "%ProgramFiles%\dnscrypt-proxy\backup\dns-proxy.reg"
ECHO [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\dnscrypt-proxy]>> "%ProgramFiles%\dnscrypt-proxy\backup\dns-proxy.reg"
ECHO "Type"=dword:00000010>> "%ProgramFiles%\dnscrypt-proxy\backup\dns-proxy.reg"
ECHO "Start"=dword:00000002>> "%ProgramFiles%\dnscrypt-proxy\backup\dns-proxy.reg"
ECHO "ErrorControl"=dword:00000000>> "%ProgramFiles%\dnscrypt-proxy\backup\dns-proxy.reg"
ECHO "ImagePath"=hex(2):22,00,43,00,3a,00,5c,00,50,00,72,00,6f,00,67,00,72,00,61,00,\>> "%ProgramFiles%\dnscrypt-proxy\backup\dns-proxy.reg"
ECHO   6d,00,20,00,46,00,69,00,6c,00,65,00,73,00,5c,00,64,00,6e,00,73,00,63,00,72,\>> "%ProgramFiles%\dnscrypt-proxy\backup\dns-proxy.reg"
ECHO   00,79,00,70,00,74,00,2d,00,70,00,72,00,6f,00,78,00,79,00,5c,00,64,00,6e,00,\>> "%ProgramFiles%\dnscrypt-proxy\backup\dns-proxy.reg"
ECHO   73,00,63,00,72,00,79,00,70,00,74,00,2d,00,70,00,72,00,6f,00,78,00,79,00,2e,\>> "%ProgramFiles%\dnscrypt-proxy\backup\dns-proxy.reg"
ECHO   00,65,00,78,00,65,00,22,00,20,00,2d,00,63,00,6f,00,6e,00,66,00,69,00,67,00,\>> "%ProgramFiles%\dnscrypt-proxy\backup\dns-proxy.reg"
ECHO   20,00,64,00,6e,00,73,00,63,00,72,00,79,00,70,00,74,00,2d,00,70,00,72,00,6f,\>> "%ProgramFiles%\dnscrypt-proxy\backup\dns-proxy.reg"
ECHO   00,78,00,79,00,2e,00,74,00,6f,00,6d,00,6c,00,00,00>> "%ProgramFiles%\dnscrypt-proxy\backup\dns-proxy.reg"
ECHO "DisplayName"="DNSCrypt Client Proxy">> "%ProgramFiles%\dnscrypt-proxy\backup\dns-proxy.reg"
ECHO "ObjectName"="LocalSystem">> "%ProgramFiles%\dnscrypt-proxy\backup\dns-proxy.reg"
ECHO "Description"="Encrypted/Authenticated DNS Proxy">> "%ProgramFiles%\dnscrypt-proxy\backup\dns-proxy.reg"
ECHO "FailureActionsOnNonCrashFailures"=dword:00000001>> "%ProgramFiles%\dnscrypt-proxy\backup\dns-proxy.reg"
ECHO "FailureActions"=hex:3c,00,00,00,00,00,00,00,00,00,00,00,03,00,00,00,14,00,00,\>> "%ProgramFiles%\dnscrypt-proxy\backup\dns-proxy.reg"
ECHO   00,01,00,00,00,30,75,00,00,01,00,00,00,30,75,00,00,01,00,00,00,30,75,00,00>> "%ProgramFiles%\dnscrypt-proxy\backup\dns-proxy.reg"
ECHO "Group"="NetworkProvider">> "%ProgramFiles%\dnscrypt-proxy\backup\dns-proxy.reg"

ECHO @ECHO OFF> "%ProgramFiles%\dnscrypt-proxy\backup\Remove_DNSCrypt-Proxy.bat"
ECHO SETLOCAL>> "%ProgramFiles%\dnscrypt-proxy\backup\Remove_DNSCrypt-Proxy.bat"
ECHO sc config dnscrypt-proxy start= disabled>> "%ProgramFiles%\dnscrypt-proxy\backup\Remove_DNSCrypt-Proxy.bat"
ECHO net stop dnscrypt-proxy>> "%ProgramFiles%\dnscrypt-proxy\backup\Remove_DNSCrypt-Proxy.bat"
ECHO sc delete dnscrypt-proxy>> "%ProgramFiles%\dnscrypt-proxy\backup\Remove_DNSCrypt-Proxy.bat"
ECHO powershell -noprofile -ExecutionPolicy Bypass -Command "& {Remove-Item -Path 'HKLM:\SYSTEM\ControlSet001\Services\dnscrypt-proxy' -Recurse -Force}">> "%ProgramFiles%\dnscrypt-proxy\backup\Remove_DNSCrypt-Proxy.bat"
ECHO powershell -noprofile -ExecutionPolicy Bypass -Command "& {Set-NetIPInterface}">> "%ProgramFiles%\dnscrypt-proxy\backup\Remove_DNSCrypt-Proxy.bat"
ECHO powershell -noprofile -ExecutionPolicy Bypass -Command "& {Get-DnsClient | Set-DnsClientServerAddress -ResetServerAddresses}">> "%ProgramFiles%\dnscrypt-proxy\backup\Remove_DNSCrypt-Proxy.bat"
ECHO RMDIR /S /Q "%%ProgramFiles%%\dnscrypt-proxy">> "%ProgramFiles%\dnscrypt-proxy\backup\Remove_DNSCrypt-Proxy.bat"

ECHO @ECHO OFF> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO SETLOCAL>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO curl --progress-bar --ssl-no-revoke --ssl-reqd --tlsv1.3 -LZRA "" "https://dblw.oisd.nl/" -o "C:\Program Files\dnscrypt-proxy\oisd_dblw_full.txt" --next ^^>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO --progress-bar --ssl-no-revoke --ssl-reqd --tlsv1.3 -LZRA "" "https://raw.githubusercontent.com/DNSCrypt/dnscrypt-resolvers/master/v3/odoh-relays.md" -o "C:\Program Files\dnscrypt-proxy\odoh-relays.md" --next ^^>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO --progress-bar --ssl-no-revoke --ssl-reqd --tlsv1.3 -LZRA "" "https://raw.githubusercontent.com/DNSCrypt/dnscrypt-resolvers/master/v3/odoh-servers.md" -o "C:\Program Files\dnscrypt-proxy\odoh-servers.md" --next ^^>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO --progress-bar --ssl-no-revoke --ssl-reqd --tlsv1.3 -LZRA "" "https://raw.githubusercontent.com/DNSCrypt/dnscrypt-resolvers/master/v3/odoh-relays.md.minisig" -o "C:\Program Files\dnscrypt-proxy\odoh-relays.md.minisig" --next ^^>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO --progress-bar --ssl-no-revoke --ssl-reqd --tlsv1.3 -LZRA "" "https://raw.githubusercontent.com/DNSCrypt/dnscrypt-resolvers/master/v3/odoh-servers.md.minisig" -o "C:\Program Files\dnscrypt-proxy\odoh-servers.md.minisig">> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO MOVE NUL 2^>^&^0>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"

curl --progress-bar --ssl-no-revoke --ssl-reqd --tlsv1.3 -LZRA "" https://github.com/DNSCrypt/dnscrypt-proxy/releases/download/2.1.2/dnscrypt-proxy-win64-2.1.2.zip -o "%ProgramFiles%\dnscrypt-proxy\dnscrypt-proxy-win64-2.1.2.zip"
tar -xf dnscrypt-proxy-win64-2.1.2.zip -C ".\backup"
CD "%ProgramFiles%\dnscrypt-proxy\backup\win64"
XCOPY "dnscrypt-proxy.exe" "%ProgramFiles%\dnscrypt-proxy\backup" /C /I /Q /G /H /R /Y /B /J
XCOPY "localhost.pem" "%ProgramFiles%\dnscrypt-proxy\backup" /C /I /Q /G /H /R /Y /B /J
CD "%ProgramFiles%\dnscrypt-proxy\backup"
RMDIR /S /Q "win64"
curl --progress-bar --ssl-no-revoke --ssl-reqd --tlsv1.3 -LZRA "" "https://dblw.oisd.nl/" -o "C:\Program Files\dnscrypt-proxy\backup\oisd_dblw_full.txt" --next ^
--progress-bar --ssl-no-revoke --ssl-reqd --tlsv1.3 -LZRA "" "https://raw.githubusercontent.com/DNSCrypt/dnscrypt-resolvers/master/v3/odoh-relays.md" -o "C:\Program Files\dnscrypt-proxy\backup\odoh-relays.md" --next ^
--progress-bar --ssl-no-revoke --ssl-reqd --tlsv1.3 -LZRA "" "https://raw.githubusercontent.com/DNSCrypt/dnscrypt-resolvers/master/v3/odoh-servers.md" -o "C:\Program Files\dnscrypt-proxy\backup\odoh-servers.md" --next ^
--progress-bar --ssl-no-revoke --ssl-reqd --tlsv1.3 -LZRA "" "https://raw.githubusercontent.com/DNSCrypt/dnscrypt-resolvers/master/v3/odoh-relays.md.minisig" -o "C:\Program Files\dnscrypt-proxy\backup\odoh-relays.md.minisig" --next ^
--progress-bar --ssl-no-revoke --ssl-reqd --tlsv1.3 -LZRA "" "https://raw.githubusercontent.com/DNSCrypt/dnscrypt-resolvers/master/v3/odoh-servers.md.minisig" -o "C:\Program Files\dnscrypt-proxy\backup\odoh-servers.md.minisig"

ECHO listen_addresses = ['127.0.0.1:53']> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO max_clients = 2500>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO ipv4_servers = true>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO ipv6_servers = false>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO dnscrypt_servers = true>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO doh_servers = true>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO odoh_servers = true>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO require_dnssec = true>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO require_nolog = true>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO require_nofilter = true>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO disabled_server_names = []>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO force_tcp = false>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO timeout = 3000>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO keepalive = ^5>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO edns_client_subnet = ["0.0.0.0/0", "2001:db8::/32"]>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO blocked_query_response = 'refused'>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO lb_strategy = 'p2'>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO lb_estimator = true>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO use_syslog = false>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO cert_refresh_delay = 240>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO dnscrypt_ephemeral_keys = true>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO tls_disable_session_tickets = true>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO tls_cipher_suite = [4866, 49196, 49200]>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO bootstrap_resolvers = ['9.9.9.11:53', '149.112.112.11:53']>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO ignore_system_dns = true>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO netprobe_timeout = -^1>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO netprobe_address = '9.9.9.11:53'>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO log_files_max_size = ^1>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO log_files_max_age = ^1>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO log_files_max_backups = ^1>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO block_ipv6 = true>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO block_unqualified = true>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO block_undelegated = true>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO reject_ttl = 10>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO cache = true>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO cache_size = 4096>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO cache_min_ttl = 2400>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO cache_max_ttl = 86400>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO cache_neg_min_ttl = 60>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO cache_neg_max_ttl = 600>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO [captive_portals]>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO [local_doh]>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO [query_log]>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO format = 'tsv'>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO [nx_log]>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO format = 'tsv'>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO [blocked_names]>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO blocked_names_file = 'oisd_dblw_full.txt'>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO [blocked_ips]>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO [allowed_names]>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO [allowed_ips]>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO [schedules]>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO [sources]>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO [sources.'odoh-servers']>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO urls = ['https://raw.githubusercontent.com/DNSCrypt/dnscrypt-resolvers/master/v3/odoh-servers.md', 'https://download.dnscrypt.info/resolvers-list/v3/odoh-servers.md', 'https://ipv6.download.dnscrypt.info/resolvers-list/v3/odoh-servers.md', 'https://download.dnscrypt.net/resolvers-list/v3/odoh-servers.md']>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO cache_file = 'odoh-servers.md'>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO minisign_key = 'RWQf6LRCGA9i53mlYecO4IzT51TGPpvWucNSCh1CBM0QTaLn73Y7GFO3'>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO refresh_delay = 168>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO prefix = ''>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO [sources.'odoh-relays']>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO urls = ['https://raw.githubusercontent.com/DNSCrypt/dnscrypt-resolvers/master/v3/odoh-relays.md', 'https://download.dnscrypt.info/resolvers-list/v3/odoh-relays.md', 'https://ipv6.download.dnscrypt.info/resolvers-list/v3/odoh-relays.md', 'https://download.dnscrypt.net/resolvers-list/v3/odoh-relays.md']>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO cache_file = 'odoh-relays.md'>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO minisign_key = 'RWQf6LRCGA9i53mlYecO4IzT51TGPpvWucNSCh1CBM0QTaLn73Y7GFO3'>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO refresh_delay = 168>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO prefix = ''>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO [broken_implementations]>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO fragments_blocked = ['cisco', 'cisco-ipv6', 'cisco-familyshield', 'cisco-familyshield-ipv6', 'cleanbrowsing-adult', 'cleanbrowsing-adult-ipv6', 'cleanbrowsing-family', 'cleanbrowsing-family-ipv6', 'cleanbrowsing-security', 'cleanbrowsing-security-ipv6']>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO [doh_client_x509_auth]>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO [anonymized_dns]>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO routes = [>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"

FINDSTR /irc:"## o" odoh-relays.md > relays_1.txt
TYPE relays_1.txt | SORT /+14 /O relays_1.txt
FOR /F "delims=## " %%A IN (relays_1.txt) DO (echo %%A>>relays_2.txt)
TYPE relays_2.txt | FIND /V "" /C > relays_3.txt
SET /P MX_LNE_RLY=<relays_3.txt

SET CNTR=1
REM FOR /F "tokens=* delims=" %%C IN (relays_2.txt) DO  (ECHO %%C)
FOR /F "tokens=* delims=" %%C IN (relays_2.txt) DO (CALL :RLY_PRCSS %%C)

IF %MX_LNE_RLY% EQU 1 (ECHO { server_name='*', via=['%Relay_[1]VAL%'] }>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml")
IF %MX_LNE_RLY% EQU 2 (ECHO { server_name='*', via=['%Relay_[1]VAL%', '%Relay_[2]VAL%'] }>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml")
IF %MX_LNE_RLY% EQU 3 (ECHO { server_name='*', via=['%Relay_[1]VAL%', '%Relay_[2]VAL%', '%Relay_[3]VAL%'] }>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml")
IF %MX_LNE_RLY% EQU 4 (ECHO { server_name='*', via=['%Relay_[1]VAL%', '%Relay_[2]VAL%', '%Relay_[3]VAL%', '%Relay_[4]VAL%'] }>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml")
IF %MX_LNE_RLY% EQU 5 (ECHO { server_name='*', via=['%Relay_[1]VAL%', '%Relay_[2]VAL%', '%Relay_[3]VAL%', '%Relay_[4]VAL%', '%Relay_[5]VAL%'] }>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml")
IF %MX_LNE_RLY% EQU 6 (ECHO { server_name='*', via=['%Relay_[1]VAL%', '%Relay_[2]VAL%', '%Relay_[3]VAL%', '%Relay_[4]VAL%', '%Relay_[5]VAL%', '%Relay_[6]VAL%'] }>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml")
IF %MX_LNE_RLY% EQU 7 (ECHO { server_name='*', via=['%Relay_[1]VAL%', '%Relay_[2]VAL%', '%Relay_[3]VAL%', '%Relay_[4]VAL%', '%Relay_[5]VAL%', '%Relay_[6]VAL%', '%Relay_[7]VAL%'] }>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml")
IF %MX_LNE_RLY% EQU 8 (ECHO { server_name='*', via=['%Relay_[1]VAL%', '%Relay_[2]VAL%', '%Relay_[3]VAL%', '%Relay_[4]VAL%', '%Relay_[5]VAL%', '%Relay_[6]VAL%', '%Relay_[7]VAL%', '%Relay_[8]VAL%'] }>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml")
IF %MX_LNE_RLY% EQU 9 (ECHO { server_name='*', via=['%Relay_[1]VAL%', '%Relay_[2]VAL%', '%Relay_[3]VAL%', '%Relay_[4]VAL%', '%Relay_[5]VAL%', '%Relay_[6]VAL%', '%Relay_[7]VAL%', '%Relay_[8]VAL%', '%Relay_[9]VAL%'] }>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml")
IF %MX_LNE_RLY% EQU 10 (ECHO { server_name='*', via=['%Relay_[1]VAL%', '%Relay_[2]VAL%', '%Relay_[3]VAL%', '%Relay_[4]VAL%', '%Relay_[5]VAL%', '%Relay_[6]VAL%', '%Relay_[7]VAL%', '%Relay_[8]VAL%', '%Relay_[9]VAL%', '%Relay_[10]VAL%'] }>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml")
IF %MX_LNE_RLY% EQU 11 (ECHO { server_name='*', via=['%Relay_[1]VAL%', '%Relay_[2]VAL%', '%Relay_[3]VAL%', '%Relay_[4]VAL%', '%Relay_[5]VAL%', '%Relay_[6]VAL%', '%Relay_[7]VAL%', '%Relay_[8]VAL%', '%Relay_[9]VAL%', '%Relay_[10]VAL%', '%Relay_[11]VAL%'] }>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml")
IF %MX_LNE_RLY% EQU 12 (ECHO { server_name='*', via=['%Relay_[1]VAL%', '%Relay_[2]VAL%', '%Relay_[3]VAL%', '%Relay_[4]VAL%', '%Relay_[5]VAL%', '%Relay_[6]VAL%', '%Relay_[7]VAL%', '%Relay_[8]VAL%', '%Relay_[9]VAL%', '%Relay_[10]VAL%', '%Relay_[11]VAL%', '%Relay_[12]VAL%'] }>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml")
IF %MX_LNE_RLY% EQU 13 (ECHO { server_name='*', via=['%Relay_[1]VAL%', '%Relay_[2]VAL%', '%Relay_[3]VAL%', '%Relay_[4]VAL%', '%Relay_[5]VAL%', '%Relay_[6]VAL%', '%Relay_[7]VAL%', '%Relay_[8]VAL%', '%Relay_[9]VAL%', '%Relay_[10]VAL%', '%Relay_[11]VAL%', '%Relay_[12]VAL%', '%Relay_[13]VAL%'] }>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml")
IF %MX_LNE_RLY% EQU 14 (ECHO { server_name='*', via=['%Relay_[1]VAL%', '%Relay_[2]VAL%', '%Relay_[3]VAL%', '%Relay_[4]VAL%', '%Relay_[5]VAL%', '%Relay_[6]VAL%', '%Relay_[7]VAL%', '%Relay_[8]VAL%', '%Relay_[9]VAL%', '%Relay_[10]VAL%', '%Relay_[11]VAL%', '%Relay_[12]VAL%', '%Relay_[13]VAL%', '%Relay_[14]VAL%'] }>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml")
IF %MX_LNE_RLY% EQU 15 (ECHO { server_name='*', via=['%Relay_[1]VAL%', '%Relay_[2]VAL%', '%Relay_[3]VAL%', '%Relay_[4]VAL%', '%Relay_[5]VAL%', '%Relay_[6]VAL%', '%Relay_[7]VAL%', '%Relay_[8]VAL%', '%Relay_[9]VAL%', '%Relay_[10]VAL%', '%Relay_[11]VAL%', '%Relay_[12]VAL%', '%Relay_[13]VAL%', '%Relay_[14]VAL%', '%Relay_[15]VAL%'] }>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml")
IF %MX_LNE_RLY% EQU 16 (ECHO { server_name='*', via=['%Relay_[1]VAL%', '%Relay_[2]VAL%', '%Relay_[3]VAL%', '%Relay_[4]VAL%', '%Relay_[5]VAL%', '%Relay_[6]VAL%', '%Relay_[7]VAL%', '%Relay_[8]VAL%', '%Relay_[9]VAL%', '%Relay_[10]VAL%', '%Relay_[11]VAL%', '%Relay_[12]VAL%', '%Relay_[13]VAL%', '%Relay_[14]VAL%', '%Relay_[15]VAL%', '%Relay_[16]VAL%'] }>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml")
IF %MX_LNE_RLY% EQU 17 (ECHO { server_name='*', via=['%Relay_[1]VAL%', '%Relay_[2]VAL%', '%Relay_[3]VAL%', '%Relay_[4]VAL%', '%Relay_[5]VAL%', '%Relay_[6]VAL%', '%Relay_[7]VAL%', '%Relay_[8]VAL%', '%Relay_[9]VAL%', '%Relay_[10]VAL%', '%Relay_[11]VAL%', '%Relay_[12]VAL%', '%Relay_[13]VAL%', '%Relay_[14]VAL%', '%Relay_[15]VAL%', '%Relay_[16]VAL%', '%Relay_[17]VAL%'] }>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml")
IF %MX_LNE_RLY% EQU 18 (ECHO { server_name='*', via=['%Relay_[1]VAL%', '%Relay_[2]VAL%', '%Relay_[3]VAL%', '%Relay_[4]VAL%', '%Relay_[5]VAL%', '%Relay_[6]VAL%', '%Relay_[7]VAL%', '%Relay_[8]VAL%', '%Relay_[9]VAL%', '%Relay_[10]VAL%', '%Relay_[11]VAL%', '%Relay_[12]VAL%', '%Relay_[13]VAL%', '%Relay_[14]VAL%', '%Relay_[15]VAL%', '%Relay_[16]VAL%', '%Relay_[17]VAL%', '%Relay_[18]VAL%'] }>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml")
IF %MX_LNE_RLY% EQU 19 (ECHO { server_name='*', via=['%Relay_[1]VAL%', '%Relay_[2]VAL%', '%Relay_[3]VAL%', '%Relay_[4]VAL%', '%Relay_[5]VAL%', '%Relay_[6]VAL%', '%Relay_[7]VAL%', '%Relay_[8]VAL%', '%Relay_[9]VAL%', '%Relay_[10]VAL%', '%Relay_[11]VAL%', '%Relay_[12]VAL%', '%Relay_[13]VAL%', '%Relay_[14]VAL%', '%Relay_[15]VAL%', '%Relay_[16]VAL%', '%Relay_[17]VAL%', '%Relay_[18]VAL%', '%Relay_[19]VAL%'] }>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml")
IF %MX_LNE_RLY% EQU 20 (ECHO { server_name='*', via=['%Relay_[1]VAL%', '%Relay_[2]VAL%', '%Relay_[3]VAL%', '%Relay_[4]VAL%', '%Relay_[5]VAL%', '%Relay_[6]VAL%', '%Relay_[7]VAL%', '%Relay_[8]VAL%', '%Relay_[9]VAL%', '%Relay_[10]VAL%', '%Relay_[11]VAL%', '%Relay_[12]VAL%', '%Relay_[13]VAL%', '%Relay_[14]VAL%', '%Relay_[15]VAL%', '%Relay_[16]VAL%', '%Relay_[17]VAL%', '%Relay_[18]VAL%', '%Relay_[19]VAL%', '%Relay_[20]VAL%'] }>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml")

GOTO LSTLBL_

ECHO RELAYS: && FOR /L %%C IN (1,1,%MX_LNE_RLY%) DO (ECHO LINE: %%C VAL: !Relay_[%%C]VAL!)

:RLY_PRCSS
SET Relay_[%CNTR%]VAL=%1
IF %CNTR% EQU %MX_LNE_RLY% (GOTO LST_RLY)
SET /A CNTR+=1
:LST_RLY
GOTO :EOF

:LSTLBL_

DEL /Q "relays_*.txt" && DEL /Q "%ProgramFiles%\dnscrypt-proxy\dnscrypt-proxy-win64-2.1.2.zip"

ECHO ]>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO skip_incompatible = true>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO [dns64]>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO [static]>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"

XCOPY "*.*" "%ProgramFiles%\dnscrypt-proxy" /E /C /I /Q /G /H /R /Y /B /J
CD "%ProgramFiles%\dnscrypt-proxy"
RMDIR /S /Q "%ProgramFiles%\dnscrypt-proxy\backup"
powershell -noprofile -ExecutionPolicy Bypass -Command "& {Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope CurrentUser -Force}"
powershell -noprofile -ExecutionPolicy Bypass -Command "& {Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope LocalMachine -Force}"
powershell -noprofile -ExecutionPolicy Bypass -Command "& {Set-PSReadLineOption -HistorySaveStyle SaveNothing -MaximumHistoryCount 1}"
powershell -noprofile -ExecutionPolicy Bypass -Command "& {Write-Output 'Remove-Module PSReadline' | New-Item -Path $PROFILE -Type File -Force}"
powershell -noprofile -ExecutionPolicy Bypass -Command "& {[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls13}"
powershell -noprofile -ExecutionPolicy Bypass -Command "& {Get-NetAdapter | Enable-NetAdapter}"
powershell -noprofile -ExecutionPolicy Bypass -Command "& {Set-NetIPInterface}"
powershell -noprofile -ExecutionPolicy Bypass -Command "& {Get-DnsClient | Set-DnsClientServerAddress -ResetServerAddresses}"
powershell -noprofile -ExecutionPolicy Bypass -Command "& {Get-NetAdapterBinding | Enable-NetAdapterBinding -AllBindings -IncludeHidden -componentid 'ms_netbios'}"
powershell -noprofile -ExecutionPolicy Bypass -Command "& {Get-NetAdapterBinding | Disable-NetAdapterBinding -AllBindings -IncludeHidden -componentid 'ms_netbios'}"
powershell -noprofile -ExecutionPolicy Bypass -Command "& {Get-NetAdapterBinding | Disable-NetAdapterBinding -componentid 'ms_tcpip6'}"
powershell -noprofile -ExecutionPolicy Bypass -Command "& {Get-NetAdapterBinding | Disable-NetAdapterBinding -componentid 'ms_msclient'}"
powershell -noprofile -ExecutionPolicy Bypass -Command "& {Get-NetAdapterBinding | Disable-NetAdapterBinding -componentid 'ms_server'}"
powershell -noprofile -ExecutionPolicy Bypass -Command "& {Get-NetAdapterBinding | Disable-NetAdapterBinding -componentid 'ms_pacer'}"
powershell -noprofile -ExecutionPolicy Bypass -Command "& {Get-NetAdapterBinding | Disable-NetAdapterBinding -componentid 'ms_implat'}"
powershell -noprofile -ExecutionPolicy Bypass -Command "& {Get-NetAdapterBinding | Disable-NetAdapterBinding -componentid 'ms_lldp'}"
powershell -noprofile -ExecutionPolicy Bypass -Command "& {Get-NetAdapterBinding | Disable-NetAdapterBinding -componentid 'ms_rspndr'}"
powershell -noprofile -ExecutionPolicy Bypass -Command "& {Get-DnsClient | Set-DnsClientServerAddress -ResetServerAddresses}"
powershell -noprofile -ExecutionPolicy Bypass -Command "& {Get-DnsClient | Set-DnsClientServerAddress -ServerAddresses ('127.0.0.1','9.9.9.11')}"
powershell -noprofile -ExecutionPolicy Bypass -Command "& {Get-DnsClient | Set-DNSClient -RegisterThisConnectionsAddress $False -UseSuffixWhenRegistering $False -ConnectionSpecificSuffix ' '}"
sc create dnscrypt-proxy binPath= "\"C:\Program Files\dnscrypt-proxy\dnscrypt-proxy.exe\" -config dnscrypt-proxy.toml" group= NetworkProvider displayname= "DNSCrypt Client Proxy"
sc description dnscrypt-proxy "Encrypted/Authenticated DNS Proxy"
sc failureflag dnscrypt-proxy 1
sc failure dnscrypt-proxy reset= 60 actions= restart/30000/restart/30000/restart/30000/
sc config dnscrypt-proxy start= auto
net start dnscrypt-proxy

 

NOTE: You may have to install WSL first through the command line to utilize BSDTar / cURL.

 

(2.) Use Notepad to create this file on your desktop or another folder: Auto_Update_WSL.bat

 

@ECHO OFF
SETLOCAL
sc config BITS start= delayed-auto
sc config EventLog start= auto
sc config UsoSvc start= auto
sc config wuauserv start= auto
net start BITS
net start EventLog
net start UsoSvc
net start wuauserv
powershell -noprofile -ExecutionPolicy Bypass -Command "& {Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope CurrentUser -Force}"
powershell -noprofile -ExecutionPolicy Bypass -Command "& {Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope LocalMachine -Force}"
powershell -noprofile -ExecutionPolicy Bypass -Command "& {Set-PSReadLineOption -HistorySaveStyle SaveNothing -MaximumHistoryCount 1}"
powershell -noprofile -ExecutionPolicy Bypass -Command "& {Write-Output 'Remove-Module PSReadline' | New-Item -Path $PROFILE -Type File -Force}"
powershell -noprofile -ExecutionPolicy Bypass -Command "& {[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls13}"
powershell -noprofile -ExecutionPolicy Bypass -Command "& {Install-PackageProvider -Name PowerShellGet -Scope AllUsers -Force}"
powershell -noprofile -ExecutionPolicy Bypass -Command "& {Install-PackageProvider -Name NuGet -Scope AllUsers -Force}"
powershell -noprofile -ExecutionPolicy Bypass -Command "& {Install-PackageProvider -Name WinGet -Scope AllUsers -Force}"
powershell -noprofile -ExecutionPolicy Bypass -Command "& {Register-PackageSource -Name 'Nuget Gallery' -Location https://api.nuget.org/v3/index.json -Trusted -Force -ProviderName NuGet}"
DISM /Online /Enable-Feature /All /Norestart /FeatureName:Microsoft-Windows-Subsystem-Linux
DISM /Online /Enable-Feature /All /Norestart /FeatureName:VirtualMachinePlatform
DISM /Online /Enable-Feature /All /Norestart /FeatureName:HypervisorPlatform
REM NOTE: If the "Microsoft App Installer" doesn't install, then you have to go into the Microsoft Store ( App ) and hit the "Retry" button.
winget install 9NBLGGH4NNS1 --silent --accept-package-agreements --accept-source-agreements
winget install Microsoft.VCRedist.2015+.x86 --silent --accept-package-agreements --accept-source-agreements
winget install Microsoft.VCRedist.2015+.x64 --silent --accept-package-agreements --accept-source-agreements

 

 

0 Replies