100% Private

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

Related Tools

View all Networking configurators →

Privacy Notice: This site works entirely in your browser. We don't collect or store your data. Optional analytics help us improve the site. You can deny without affecting functionality.