Note
v4_alpha_c Update: The Device Manager
This update introduces a dedicated Device Manager tab to the DNS section for automated network control and visibility.
- Auto-Discovery: Automatically detects devices on your network via BIND9 query logs.
- Quick Registration: Map local IPs to hostnames (e.g.,
mypc2.localnet) with one click. - Access Control: Directly Block or Unblock devices from DNS resolution using a managed ACL system.
- Device Cleanup: Remove stale or "unlabeled" entries from the local database.
⬡ LocalNet Manager
A single-file, self-hosted web control panel for your private LAN. DNS · Reverse Proxy · DHCP · SSL/TLS · Ad Blocking · Backups — all from your browser.
So, I let AI write the Docs/Readme. I'm slowly looking through it...as it should be good, if you find anything invalid let me know!
LocalNet Manager turns any Linux machine into a fully managed home or office network server. Instead of manually editing zone files, writing Nginx configs by hand, or remembering certbot flags — everything is a button click in a browser UI running on port 8091.
It ships as a single Python file. No Docker, no complex setup. Run it with sudo, open your browser, and your network is under control in minutes.
| Feature | Description | |
|---|---|---|
| 🌐 | BIND9 DNS Server | Private TLD with A, CNAME, TXT, SRV, and wildcard records |
| Nginx Reverse Proxy | 5 built-in templates: Basic, WebSocket, Home Assistant, Nextcloud, Load Balancer | |
| 📡 | DHCP Server | ISC-DHCP with range, gateway, lease time, and DNS injection |
| 🔒 | SSL / TLS | Local CA via mkcert + globally trusted Let's Encrypt via DNS-01 (no port 80 needed) |
| 🚫 | Network Ad Blocking | BIND9 RPZ powered by the StevenBlack hosts list — 100k–200k domains blocked network-wide |
| 💾 | Automatic Backups | ZIP snapshots of /etc/bind and /etc/nginx before every operation, one-click restore |
| 📜 | Live System Logs | Real-time journalctl stream for BIND9, Nginx, DHCP, and systemd-resolved |
| 🔌 | VPN Compatible | Routes through systemd-resolved so VPN clients can still inject their own DNS |
| 🔐 | Authentication | Session-based login with SHA-256 hashed passwords |
![]() DNS Server Setup |
![]() DNS Records |
![]() Nginx Proxy Templates |
![]() Ad Blocking (175k+ domains) |
![]() SSL / TLS — mkcert Local CA |
![]() Backups & Restore |
Requirements: Ubuntu 22.04+ or Debian 12+, Python 3.10+, must run as root.
# 1. Install Flask
pip3 install flask
# 2. Run
sudo python3 localnet_v4_alpha_b.pyThen open http://<your-server-ip>:8091 in your browser.
Default password:
localnet— change it immediately in Settings.
Once logged in, the recommended order is:
- Settings → Change your password
- Network → Confirm your server IP is detected correctly
- DNS → Setup → Install BIND9 with your chosen TLD (default:
.localnet) - DNS → Records → Add an A record for your server (
ns1,mypc, etc.) - Nginx Proxy → Install / Remove → Install Nginx
- Nginx Proxy → Add Proxy → Add your first reverse proxy
- SSL / TLS → Install
mkcertand generate a cert for your domain
# /etc/systemd/system/localnet.service
[Unit]
Description=LocalNet Manager v4
After=network.target
[Service]
ExecStart=/usr/bin/python3 /path/to/localnet_v4_alpha_b.py
Restart=on-failure
User=root
[Install]
WantedBy=multi-user.targetsudo systemctl daemon-reload
sudo systemctl enable --now localnetBrowser (port 8091)
└── Flask REST API + SSE log stream
└── Bash scripts via subprocess (run as root, async in daemon threads)
├── BIND9 → /etc/bind/
├── Nginx → /etc/nginx/sites-{available,enabled}/
├── ISC-DHCP → /etc/dhcp/dhcpd.conf
├── mkcert → /etc/localnet/certs/
└── systemd-resolved → /etc/systemd/resolved.conf.d/
Every destructive operation automatically creates a ZIP backup of /etc/bind and /etc/nginx before executing. All real state lives in system config files — the app itself is stateless.
DNS resolution chain (VPN-compatible mode):
resolv.conf → 127.0.0.53 (systemd-resolved stub)
├── *.localnet → 127.0.0.1 (BIND9) ✔ local names
└── everything else → upstream / VPN DNS ✔ VPN works
| Template | Best for |
|---|---|
| Basic | Any standard HTTP service |
| WebSocket | Grafana, Jupyter, code-server |
| Home Assistant | Home Assistant with long-poll + WebSocket |
| Nextcloud | Large file uploads (10GB), CalDAV/CardDAV redirects |
| Load Balancer | Round-robin across multiple upstream servers |
LocalNet's ad blocking works at the DNS layer — no browser extension or separate proxy needed. It uses BIND9's Response Policy Zone (RPZ) feature with the StevenBlack unified hosts list. Blocked domains return NXDOMAIN instantly to every device on your network.
Best for: pure local networks, no public domain required.
- Generates a local CA trusted by your machine
- Issues
*.localnetcerts with no port 80 or internet access needed - Other devices trust the certs by importing the Root CA once
Best for: publicly registered domains, globally browser-trusted certs.
- Uses Certbot with the DNS-RFC2136 plugin
- Writes a temporary TXT record to your BIND9 zone to prove ownership
- No port 80, no public IP required
- Requires a real, publicly resolvable domain you own
| Dependency | Type | Notes |
|---|---|---|
flask |
pip | Only external Python dependency |
bind9 bind9utils dnsutils |
apt | Installed on demand via DNS Setup |
nginx |
apt | Installed on demand via Nginx page |
isc-dhcp-server |
apt | Installed on demand via DHCP page |
mkcert |
binary | Downloaded from GitHub releases |
certbot python3-certbot-dns-rfc2136 |
apt | Installed on demand via SSL page |
All standard library modules (sqlite3, subprocess, threading, zipfile, etc.) — no additional installs.
⚠️ Designed for trusted LAN use only. Do not expose port 8091 to the internet.
- Passwords stored as SHA-256 hash in
/etc/localnet/config.json - Password comparison uses
hmac.compare_digest()(timing-safe) - Flask session secret auto-generated with
secrets.token_hex(32)and persisted across restarts - All API routes (except
/login) require an active session — unauthenticated requests return HTTP 401
/etc/localnet/
├── config.json # App configuration & password hash
├── localnet.db # SQLite: notes, backup history
├── certs/ # mkcert-issued certificates
├── ca/ # mkcert local CA root
├── backups/ # ZIP snapshots (auto + manual)
└── certbot/ # Certbot TSIG key & rfc2136.ini
Full API reference, UI guide, architecture diagrams, troubleshooting, and more:
Issues and pull requests are welcome. This is an alpha release — expect rough edges.
- Fork the repo
- Make your changes to
localnet_v4_alpha_b.py - Test with
sudo python3 localnet_v4_alpha_b.py - Open a PR describing what changed and why






