hostess
idempotent command-line tool for managing /etc/hosts
TLDR
Add a host entry
$ sudo hostess add [local.example.com] [127.0.0.1]
Remove a host entry$ sudo hostess rm [local.example.com]
List all entries$ hostess ls
Enable a disabled entry$ sudo hostess on [local.example.com]
Disable an entry$ sudo hostess off [local.example.com]
Check if entry exists$ hostess has [local.example.com]
SYNOPSIS
hostess command [arguments]
DESCRIPTION
hostess is an idempotent command-line tool for managing /etc/hosts. It simplifies adding, removing, and toggling host entries for development and testing. Entries can be disabled without removal. Requires root/sudo on Unix or elevated prompt on Windows.
SUBCOMMANDS
add hostname ip
Add or update host entry.rm hostname
Remove host entry.ls
List all entries.on hostname
Enable a disabled entry.off hostname
Disable an entry.has hostname
Check if entry exists.fix
Reformat hosts file.
CAVEATS
Modifying /etc/hosts requires elevated privileges. Set HOSTESSPATH to override default hosts file location. Set HOSTESSFMT to 'windows' or 'unix' to override format detection.
SEE ALSO
hosts(5)
