hostctl
Manage /etc/hosts with profiles
TLDR
SYNOPSIS
hostctl command [options] [arguments]
DESCRIPTION
hostctl is a CLI tool for managing your /etc/hosts file using profiles. You can have multiple profiles, enable or disable exactly what you need, and switch between different host configurations with simple commands. It automatically detects your OS and uses the correct hosts file location.
Profiles allow grouping host entries for different environments (development, staging, production) and toggling them on or off without manual file editing. It also supports syncing profiles with Docker and Docker Compose containers.
PARAMETERS
list
Show a detailed list of profiles and entriesadd profile ip hostname
Add an entry to a profileenable profile
Enable a profiledisable profile
Disable a profileremove profile
Remove a profile entirelyset profile
Replace content of a profilebackup
Create a backup of the hosts filesync
Sync with Docker or Docker Compose
CAVEATS
Modifying the hosts file requires root/administrator privileges. Incorrect entries can break local DNS resolution. Always use the backup command before making large changes.
HISTORY
hostctl was created by guumaster and is written in Go. It was designed to replace manual editing of the hosts file with a structured, profile-based approach that integrates with modern development workflows.
SEE ALSO
hosts(5)

