An open source script tests VPN connection for DNS Leak. https://bash.ws/dnsleak
  • Batchfile 26.7%
  • Shell 25.6%
  • Go 24.9%
  • Python 22.8%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-10-13 02:26:10 +02:00
.github/workflows Add macOS build 2026-09-15 20:14:35 +02:00
dnsleaktest.bat Fix param validation 2026-10-13 02:26:10 +02:00
dnsleaktest.go Fix param validation 2026-10-13 02:26:10 +02:00
dnsleaktest.py Fix param validation 2026-10-13 02:26:10 +02:00
dnsleaktest.sh Fix param validation 2026-10-13 02:26:10 +02:00
LICENSE DNS servers count was added 2018-08-22 11:16:13 +03:00
README.md Improve watch mode 2026-10-13 02:20:40 +02:00

DNS Leak Test

This tool reports your external IP address and the DNS servers used by your connection. If their network providers differ unexpectedly, your DNS traffic may be leaking outside the intended connection or VPN.

Linux and macOS

How to install and use the shell version

Please, before use make sure you have curl and ping installed.

  1. Download dnsleaktest.sh from v1.4:
curl -fLO https://raw.githubusercontent.com/macvk/dnsleaktest/v1.4/dnsleaktest.sh
chmod +x dnsleaktest.sh
  1. Run it:
./dnsleaktest.sh

How to install and use the Python version

  1. Download dnsleaktest.py from v1.4:
curl -fLO https://raw.githubusercontent.com/macvk/dnsleaktest/v1.4/dnsleaktest.py
chmod +x dnsleaktest.py
  1. Run it:
./dnsleaktest.py

Windows

How to install and use the batch file

  1. Download dnsleaktest.bat
Invoke-WebRequest -UseBasicParsing https://raw.githubusercontent.com/macvk/dnsleaktest/v1.4/dnsleaktest.bat -OutFile dnsleaktest.bat
  1. Run dnsleaktest.bat:
dnsleaktest.bat

Prebuilt Go executables

Version 1.4 executables are built by GitHub Actions and published on the v1.4 release page.

Linux

After downloading the correct executable for your system:

chmod +x dnsleaktest-linux-amd64
./dnsleaktest-linux-amd64

macOS

The macOS executables are unsigned. macOS may ask you to confirm that you want to run a downloaded executable.

Windows

Open Command Prompt, navigate to the download directory, and run the downloaded executable.

Build from source

Install Go, then select the target operating system and architecture. Examples:

GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o dnsleaktest-linux-amd64 dnsleaktest.go
GOOS=darwin GOARCH=arm64 CGO_ENABLED=0 go build -o dnsleaktest-darwin-arm64 dnsleaktest.go
GOOS=windows GOARCH=amd64 CGO_ENABLED=0 go build -o dnsleaktest-windows-amd64.exe dnsleaktest.go

How to run from Docker

Linux

docker run --rm --network host python:alpine sh -c 'wget -q -O- https://raw.githubusercontent.com/macvk/dnsleaktest/v1.4/dnsleaktest.py | python'

macOS and Windows

docker run --rm python:alpine sh -c 'wget -q -O- https://raw.githubusercontent.com/macvk/dnsleaktest/v1.4/dnsleaktest.py | python'