A Firefox extension that overrides DNS resolution for selected domains on a per-tab basis. Think of it as a browser-specific hosts file for local development.
- Override hostname-to-IP resolution for any domain
- Enable/disable overrides per-tab (test production and local side-by-side)
- Visual indicator shows which tabs have overrides active
- Persists mappings across browser sessions
When developing locally, you often need to test your app with production hostnames (for cookies, CORS, OAuth callbacks, etc.). Instead of editing your system hosts file, fhosts lets you:
- Map
myapp.comto127.0.0.1 - Enable the override only in specific tabs
- Keep other tabs using real DNS
Install from Firefox Add-ons or load temporarily via about:debugging.
The extension requires a native proxy helper to perform the actual IP substitution.
- Download the latest release from GitHub Releases
- Extract the zip file
- Run
install.bat(Windows) - Restart Firefox
- Click the fhosts icon in the toolbar
- Add a hostname mapping (e.g.,
myapp.com->127.0.0.1) - Toggle "This tab" to enable overrides for the current tab
- Navigate to your mapped domain
The icon turns cyan when overrides are active for the current tab.
When accessing HTTPS sites through fhosts, you'll see certificate warnings because the certificate won't match the IP you're connecting to. For local development, you can:
- Use a local SSL proxy (like mkcert + local reverse proxy)
- Accept the certificate warning for testing purposes
The extension files can be loaded directly in Firefox via about:debugging > "Load Temporary Add-on".
Requires Go 1.21+:
cd proxy
go build -ldflags="-s -w" -o fhosts-proxy.exe main.go- The extension uses Firefox's proxy API to intercept requests
- For mapped hostnames on enabled tabs, requests route through a local proxy (port 8899)
- The proxy helper connects to the configured IP instead of resolving DNS
- HTTPS works via CONNECT tunneling with hostname substitution
- Remove the extension from Firefox
- Run
uninstall.batin the proxy folder (removes registry entry) - Delete the proxy folder
MIT License - see LICENSE