A lightweight HTTP server that returns HTTP 204 (No Content) for Android connectivity checks. Designed for offline device provisioning scenarios.
Note: These instructions are for Windows 10/11 PCs. Download and set up all required files before going offline or to your provisioning location.
-
Dual DHCP DNS Server
- Download from: http://dhcp-dns-server.sourceforge.net/
- Run the installer (default installation location:
C:\DualServer\) - The installer creates a Windows service that can run automatically
-
Simple204Server.exe
- Download the latest release from this repository's Releases page
- Save to a convenient location (e.g.,
C:\Provisioning\)
-
Sample DualServer.ini configuration
- Included in this repository
- Copy to your DualServer installation folder (typically
C:\DualServer\)
- Open Settings → Network & Internet → Mobile hotspot
- Toggle "Share my Internet connection with other devices" to On
- Note your network name and password
- Your laptop will typically get IP address: 192.168.137.1
- Navigate to your DualServer installation folder (typically
C:\DualServer\) - Copy the
DualServer.inifile from this repository into the DualServer folder (overwrite existing if prompted) - Verify the configuration includes these sections:
[DNS_HOSTS]
connectivitycheck.gstatic.com=192.168.137.1
clients3.google.com=192.168.137.1
www.google.com=192.168.137.1
[RANGE_SET]
DHCPRange=192.168.137.10-192.168.137.200
Option A: Using the Windows Service (Recommended)
- Open Services (Windows Key + R, type
services.msc) - Find "Dual DHCP DNS Server" in the list
- Right-click and select "Start"
- Optionally set to "Automatic" startup if you use this frequently
Option B: Run the executable directly
- Navigate to
C:\DualServer\ - Right-click on
DualServer.exe - Select "Run as administrator"
- Keep this window open while provisioning
-
Open Command Prompt as Administrator
- Press Windows Key
- Type
cmd - Right-click on "Command Prompt" and select "Run as administrator"
-
Navigate to where you saved Simple204Server.exe:
cd C:\Provisioning
- Run the server with your hotspot IP:
Simple204Server.exe 192.168.137.1 80
- You should see:
Server running on http://192.168.137.1:80/
Returning HTTP 204 for /generate_204
Returning HTTP 200 for all other requests
Press Ctrl+C to stop
- Keep this window open
- On your Android device, connect to your laptop's hotspot (the network name from Step 1)
- The device will automatically:
- Receive an IP address via DHCP (192.168.137.10-200 range)
- Get DNS settings pointing to your laptop
- Successfully pass connectivity checks
- Function normally in "offline" mode
"Access Denied" or "Permission Required" errors:
- Make sure you're running both DualServer.exe and Simple204Server.exe as Administrator
Android shows "No Internet" or won't connect:
- Verify both servers are running (check the console windows)
- Verify your laptop's hotspot IP is 192.168.137.1 (run
ipconfigto check) - Check Windows Firewall isn't blocking the connections
Port 80 already in use:
- Another service (IIS, Apache, etc.) might be using port 80
- Stop the conflicting service or use a different port (e.g.,
Simple204Server.exe 192.168.137.1 8080)
When setting up Android devices on isolated networks (no internet), Android performs connectivity checks by trying to reach connectivitycheck.gstatic.com/generate_204. This server responds with the expected HTTP 204 status code, allowing Android devices to function properly without real internet connectivity.
- Returns HTTP 204 for any URL containing
/generate_204 - Returns HTTP 200 for all other requests
- Lightweight single executable
- Configurable IP address and port
- Windows 10/11
- .NET Framework 4.7.2+ (pre-installed on most modern Windows systems)
- Administrator privileges (for port 80)
Simple204Server.exe <ip-address> [port]
# Listen on 192.168.137.1 port 80 (requires Administrator)
Simple204Server.exe 192.168.137.1 80
# Listen on a different port (doesn't require Administrator)
Simple204Server.exe 192.168.137.1 8080
- Open
Simple204Server.sln - Build → Build Solution (F6)
- Executable is in
Simple204Server/bin/Release/Simple204Server.exe
nuget restore
msbuild /p:Configuration=Release
MIT License - feel free to use and modify as needed.
- Dual DHCP DNS Server - Combined DHCP and DNS server for the complete solution