LinuxCommandLibrary

hostess

idempotent command-line tool for managing /etc/hosts

TLDR

Add a host entry

$ sudo hostess add [local.example.com] [127.0.0.1]
copy
Remove a host entry
$ sudo hostess rm [local.example.com]
copy
List all entries
$ hostess ls
copy
Enable a disabled entry
$ sudo hostess on [local.example.com]
copy
Disable an entry
$ sudo hostess off [local.example.com]
copy
Check if entry exists
$ hostess has [local.example.com]
copy

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)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community