WindyDNS is a Windows console DNS server that always reply to any DNS queries with a user-specified IP address. It is usually used for simulating a multiple machines or network nodes environment in a single machine. Such mock-up environments are common in software development, testing, and malware analysis.
WindyDNS is based on and adapted from Sam Trenholme's NanoDNS -- a DNS server written for Linux/Unix with remarkably short codes with 538 characters in 14 lines. The focus is on creating a working DNS server with the shortest codes possible.
WindyDNS differs from NanoDNS in the following ways:
- Ported to use Windows Socket (WinSock) API
- Tested to build with MinGW/Microsoft Visual C++ compiler
- Added CMake build system support for wider compiler support
- Retains compatibility with GNU C compiler on Linux/Unix environment
- Much longer with added comments and renamed variables to aid understanding i.e. brevity and keeping the codes short is not the focus
Tip
While WindyDNS is primarily a Windows DNS server, care is taken to ensure compatibility is retained such that it still builds and runs fine on Linux/Unix with the GCC compiler.
WindyDNS uses the CMake build system.
In the WindyDNS source directory:
mkdir build
cd build
CMake allows the use of various build tools. Common ones include the traditional GNU make, and the newer Ninja.
To use MinGW:
cmake -G "MinGW Makefiles" ..
mingw32-make
To use Microsoft Visual C++:
cmake -G "NMake Makefiles" ..
nmake
To use Microsoft Visual Studio 17 2022:
cmake -G "Visual Studio 17 2022" -A Win32 ..
msbuild
To use Ninja:
cmake -G Ninja ..
ninja
To use standard Unix makefile:
cmake -G "Unix Makefiles" ..
make
The built executable binary windydns.exe
will be in the build directory, or
for multi-configuration build in Visual Studio either in build\Release
or
build\Debug
sub-directory.
WindyDNS always bind to 0.0.0.0
. There is no way to change this currently.
To run, specify the fake IP address to be returned for all DNS queries as a command line argument.
windydns.exe <IP Address>
Example: To make WindyDNS always return 123.234.123.234
, run:
windydns.exe 123.234.123.234