A Windows command-line tool to configure static IP addresses and DNS-over-HTTPS (DoH) encryption.
# List your network interfaces
static-ip-fix.exe -l
# Enable encrypted DNS on your interface (run as Administrator)
static-ip-fix.exe -i "Ethernet" --dns-only cloudflare- Static IP Configuration - Set IPv4 and IPv6 addresses, masks, and gateways
- DNS-over-HTTPS (DoH) - Encrypt DNS queries to prevent eavesdropping
- Built-in Providers - Cloudflare (1.1.1.1) and Google (8.8.8.8) with one command
- Custom DNS - Define your own DNS servers and DoH templates
- DNS-only Mode - Enable DoH without changing your IP configuration
- Automatic Rollback - Reverts changes if any step fails
- Config File Support - Save settings in an INI file for reuse
- Windows 10 or 11
- Administrator privileges (for DNS configuration)
- CMake 3.16+ and MinGW-w64 or Visual Studio 2022 (for building from source)
Download static-ip-fix.exe from the Releases page.
git clone https://github.com/yourusername/static-ip-fix-windows.git
cd static-ip-fix-windows
make| Command | Description |
|---|---|
make |
Build release (MinGW) |
make debug |
Build with debug symbols |
make vs |
Build with Visual Studio 2022 |
make test |
Run unit tests |
make clean |
Remove build artifacts |
Output: bin/static-ip-fix.exe
static-ip-fix.exe [OPTIONS] <MODE>
| Mode | Description |
|---|---|
cloudflare |
Configure DNS with Cloudflare (1.1.1.1) + DoH |
google |
Configure DNS with Google (8.8.8.8) + DoH |
custom |
Configure DNS with custom servers from config file |
status |
Show current DNS encryption status |
| Option | Description |
|---|---|
-h, --help |
Show help message |
-l, --list-interfaces |
List available network interfaces |
-i, --interface NAME |
Specify network interface name |
-c, --config FILE |
Load configuration from FILE |
--dns-only |
Only configure DNS (skip static IP setup) |
| Option | Description |
|---|---|
--ipv4 ADDR |
IPv4 address |
--ipv4-mask MASK |
IPv4 subnet mask |
--ipv4-gateway GW |
IPv4 gateway |
--ipv6 ADDR |
IPv6 address |
--ipv6-prefix LEN |
IPv6 prefix length |
--ipv6-gateway GW |
IPv6 gateway |
# List available network interfaces
static-ip-fix.exe -l
# Quick DNS-only setup with Cloudflare
static-ip-fix.exe -i Ethernet --dns-only cloudflare
# Full static IP + DNS setup using config file
static-ip-fix.exe -c myconfig.ini cloudflare
# Check current DNS encryption status
static-ip-fix.exe -i Ethernet status
# Override config file settings with CLI arguments
static-ip-fix.exe -c config.ini --ipv4 192.168.1.50 cloudflare
# Use custom DNS provider defined in config
static-ip-fix.exe -i Ethernet customCreate a static-ip-fix.ini file in the same directory as the executable:
[interface]
name = Ethernet
[ipv4]
address = 192.168.1.100
netmask = 255.255.255.0
gateway = 192.168.1.1
[ipv6]
address = 2001:db8::100
prefix = 64
gateway = fe80::1
[dns]
ipv4_servers = 1.1.1.1, 1.0.0.1
ipv6_servers = 2606:4700:4700::1111, 2606:4700:4700::1001
[doh]
template = https://cloudflare-dns.com/dns-query
autoupgrade = yes
fallback = noSee static-ip-fix.example.ini for a complete example.
The [dns] and [doh] sections are used with the custom mode.
Command line arguments override config file values. This allows you to use a base config file while overriding specific settings:
# Use config file but override the interface
static-ip-fix.exe -c config.ini -i "Wi-Fi" cloudflareIf you just want to enable DoH without changing your IP configuration, use the --dns-only flag:
static-ip-fix.exe -i Ethernet --dns-only cloudflareThis will:
- Set DNS servers to Cloudflare (1.1.1.1, 1.0.0.1, IPv6 variants)
- Configure DoH encryption templates
- Enable auto-upgrade with no UDP fallback
Your existing IP configuration remains unchanged.
DNS-over-HTTPS (DoH) encrypts your DNS queries, preventing ISPs and network observers from seeing which websites you visit. This tool configures Windows to use DoH with these settings:
- Auto-upgrade: Automatically uses DoH when available
- No UDP fallback: Refuses unencrypted DNS (strict mode)
Under the hood, the tool executes netsh commands to:
- Set DNS server addresses (IPv4 and IPv6)
- Register DoH encryption templates
- Optionally configure static IP addresses
If any step fails during configuration, the tool automatically rolls back:
- Resets DNS to DHCP
- Removes DoH encryption templates
This ensures you don't end up with a half-configured network.
| Problem | Solution |
|---|---|
| "Access denied" error | Run as Administrator (right-click → Run as administrator) |
| Interface not found | Use -l to list interfaces; use exact name with quotes if it contains spaces |
| No internet after config | Verify your gateway IP matches your router; run with --dns-only to skip IP config |
| Status shows "NOT ENCRYPTED" | Ensure Windows is updated; DoH requires Windows 10 build 19628+ |
- Uses
CreateProcessWfor process execution (no shell injection) - Safe string formatting with
StringCchPrintfW - Input validation for interface names
- No plaintext password handling
MIT License - see LICENSE file.
Issues and pull requests are welcome on GitHub.