Hosts File Generator and Parser
WebEverything runs locally in your browser — nothing is uploaded
The hosts format looks trivial — an IP and a hostname on one line — but a few rules get silently ignored: a line may carry several hostnames (they are aliases of one another), `#` starts a comment (whole-line or trailing), spaces and tabs are both fine between fields, and `0.0.0.0` is the usual way to block a domain. This tool does both jobs: parsing lists every `IP → hostname` entry and checks for invalid IPs, duplicate IPs, duplicate hostnames, IPv6 entries and blocking entries; generating turns "one hostname per line" into a hosts file with an optional comment header. Parsing and generation both happen in your browser. Nothing is uploaded and no request is made.
Features
- Parse mode lists every IP → hostname entry
- Multiple hostnames on one line are listed separately, not merged
- Whole-line and trailing # comments handled apart
- Checks for invalid IPs, duplicate IPs and duplicate hostnames
- Marks IPv6 entries and 0.0.0.0 blocking entries
- Generate mode turns one hostname per line into a hosts file
- Spaces and tabs between fields are both accepted
- Runs entirely locally, with no network requests
How to use
- Choose Parse or Generate
- Parse: paste a whole hosts file
- Generate: one hostname per line, optionally as "IP hostname", with the default IP filling in the rest
- Copy the generated file or the check results
FAQ
- What is the difference between 0.0.0.0 and 127.0.0.1 for blocking?
- Both stop a domain resolving to its real address, but `0.0.0.0` is the safer, more common choice: it points at an invalid address, so connections fail immediately. `127.0.0.1` points the domain at your own machine, and if something happens to be listening on that port you may connect to an unexpected service. That is why modern block lists use `0.0.0.0`.
- How many hostnames can one line hold?
- As many as you like. Hostnames on one line are aliases that resolve to the same IP — `127.0.0.1 a.local b.local` makes both names point at your machine. This tool lists them individually when parsing (rather than merging them) and accepts `IP name1 name2` when generating.
- Why flag duplicate hostnames?
- Because when the same hostname maps to different IPs on different lines, only the first entry takes effect and the rest are ignored — a confusing "I changed it and nothing happened". Listing the duplicates lets you confirm whether a stale entry is still sitting there.
- Where is the hosts file, and do I need to reboot?
- It is `/etc/hosts` on Linux and macOS, and `C:\Windows\System32\drivers\etc\hosts` on Windows — both need administrator rights. Changes usually take effect immediately, with no reboot; but a browser may have cached the DNS answer, so restart it or flush the OS cache (on Windows, `ipconfig /flushdns`).
Related tools
DNS lookup
WebLook up DNS records for any domain: A, AAAA, MX, TXT, NS, CNAME, SOA and CAA, with TTLs and parsed fields. Queries go straight from your browser.
CIDR Calculator
WebTurn 192.168.1.0/24 into a network address, broadcast address, netmask, wildcard mask and usable host range. Runs in your browser.
IP to Integer
WebConvert between IP addresses and integers: dotted decimal, unsigned and signed, hex, binary. IPv6 uses exact 128-bit arithmetic.
URL Parser
WebParse a URL into scheme, host, port, path, query parameters and fragment, with each parameter shown raw and decoded. Runs entirely in your browser.
User-Agent Parser
WebParse a user agent into browser, version, OS, device type and engine, and see which rules matched. Pattern matching only. Runs entirely in your browser.
HTTP Status Codes
WebLook up an HTTP status code for its meaning, 1xx–5xx class, typical uses and common traps. Runs entirely in your browser.