Hosts File Generator - Create Custom DNS Entries
Generate hosts file entries for local DNS overrides. Block domains, create dev environments, and manage local hostname resolution across platforms.
Space-separated additional hostnames
Quick Add
File Locations
| Linux/Mac: | /etc/hosts |
| Windows: | C:\Windows\System32\drivers\etc\hosts |
Edit Commands
# Linux/Mac - edit with sudo
sudo nano /etc/hosts
# or
sudo vim /etc/hosts
# Windows - run as Administrator
notepad C:\Windows\System32\drivers\etc\hosts
# Flush DNS cache after editing
# Mac:
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
# Linux:
sudo systemctl restart systemd-resolved
# Windows:
ipconfig /flushdns