Quick & Simple Way using Adguard "dnsproxy" on Windows:
- Put executable you get from release page, or consider use the custom build one (more on this later) -- on
%appdata%\dnsproxy
- Put this VBScript on Startup folder:
- Your user startup at
shell:startup
OR All Users startup atshell:common startup
- Your user startup at
- Create shortcut of previously saved VBScript on the Startup folder to Desktop for easier access (Useful on the event of dnsproxy may seems to hang)
- Plus, you can change the shortcut icon as you wish :)
- Customize dnsproxy options as you like by changing the
L4
ofdnsproxy.vbs
. For available options, learn more on dnsproxy README file.- I put bare config: primary upstream (
-u
) using Cloudflare DNS and fallback (-f
) using Quad9 DNS (both in DNS-over-TLS); with 1MB in-memory cache (--cache --cache-size=<int in Bytes>
); listen on localhost (-l 127.0.0.1
)
- I put bare config: primary upstream (
- Finish! Now dnsproxy always start on boot, and if needed, restart using shortcut we made on the desktop.
It is better to have dnsproxy.exe exec compiled as windowsgui
.
-
This will remove dependency of shell host 'Console Window Host' as we don't need shell and it's daemonized on the background afterall.
-
You may want to use x86 exec, as I notice lower memory footprint on x86 builds. so first set GOARCH to 386
go env -w GOARCH=386
-
Use this go build command after you clone the repo and also you may also need to checkout to stable tags/version:
go build -mod=vendor -ldflags "-s -w -X main.VersionString=<TYPE VERSION HERE>" -H windowsgui
-
Note that this executable will not output anything, so it's not debuggable. Logging in this mode only can be achieved if somehow dnsproxy maintainer adds 'logging to file' function.