# 使用 Homebrew, Nix, pacman 安装 hostess

查看 hostess 的安装路径、可执行文件、元数据以及面向 AI 代理工作流的安全说明。

## 安装

```sh
sudo av install brew:hostess
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install hostess
```

  证据: local Homebrew formula metadata

### Linux

- Nix (92%):

```sh
nix profile install nixpkgs#hostess
```

  证据: nixpkgs package indexes: pkgs/by-name/ho/hostess/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

- pacman (92%):

```sh
sudo pacman -S hostess
```

  证据: Arch Linux sync databases: hostess from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz

## 软件包事实

- **软件包键:** brew:hostess
- **软件包管理器:** Homebrew
- **版本:** 0.5.2
- **来源摘要:** Idempotent command-line utility for managing your /etc/hosts file
- **主页:** <https://github.com/cbednarski/hostess>
- **仓库:** <https://github.com/cbednarski/hostess>
- **最后更新:** 2026-07-27T14:32:25+02:00
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- hostess (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

- 页面生成时间: 2026-08-03
- 管理器版本: 0.5.2
## 项目历史与用法

hostess is a Go command-line utility for idempotently managing hosts-file entries. Its niche is deliberately small: add, remove, list, format, enable, disable, dump, and apply entries in `/etc/hosts` or the Windows hosts file without hand-editing the file.

### 项目历史

Chris Bednarski's README frames the motivation plainly: developers edit hosts files for development, testing, debugging, and production DNS failures, and manual edits are annoying. The project turns that workflow into a repeatable CLI suitable for Makefiles and deployment scripts.

The changelog shows the package starting with v0.1.0 in 2015, then adding build reliability, fixed-format checks, Windows support, Go module support, and a significant CLI/API cleanup in 2020.

### 采用历史

hostess reached users through GitHub releases and package managers including Homebrew, Nix, and Arch. Its cross-platform behavior matters for adoption because the Unix hosts file and Windows hosts file have different paths and formatting expectations.

### 使用方式

Common usage is `hostess add name ip`, `hostess rm name`, `hostess ls`, `hostess off name`, `hostess on name`, `hostess fmt`, `hostess dump`, and `hostess apply`. The README notes that elevated privileges are required because hosts files are protected by the operating system.

Environment variables provide the small amount of configuration the tool needs: `HOSTESS_FMT` can override format detection and `HOSTESS_PATH` can override the hosts-file path.

### 为什么软件包爱好者会关心

hostess is a tidy example of a package-manager-friendly utility: one small executable, obvious system integration, no daemon, and behavior that replaces a risky manual edit. The 2020 refactor is also package-relevant because it removed an external CLI dependency and modernized Go tooling.

### 时间线

- 2015: v0.1.0 initial release.
- 2016: v0.2.x vendors the CLI dependency for more reliable builds.
- 2018: v0.3.0 adds a fixed-format check and improves parsing failure behavior.
- 2020: v0.4.0 refactors the CLI/API, removes external dependency usage, and adds Go module support.
- 2020: v0.5.0 adds a Windows-specific hosts format.
- 2020: v0.5.2 fixes and clarifies duplicate/conflicting entry handling in format mode.

### Related projects

- The Unix `/etc/hosts` file and Windows `C:\Windows\System32\drivers\etc\hosts` file are the managed targets.
- Other hosts-file editors and local-development DNS helpers are related by workflow.
- Go module tooling is related through the v0.4.0 project modernization.

### 来源

- CHANGELOG.md: release timeline and major behavior changes.
- GitHub README: purpose, examples, hosts-file paths, environment variables, and privilege notes.
- Homebrew input metadata: package-manager identity and ecosystem tags.


## 安全说明

narrow executable package without higher-risk signals.

- **Geiger 风险:** 绿色 / 低
- narrow executable package without higher-risk signals

## 其他软件包管理器记录

- Nix - hostess: normalized package name match | nixpkgs package indexes: pkgs/by-name/ho/hostess/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- pacman - hostess - 0.5.2-5: normalized package name match | Arch Linux sync databases: hostess from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz | An idempotent command-line utility for managing your /etc/hosts file. | https://github.com/cbednarski/hostess


## Combined YAML source

View the package source record on GitHub. [combined/hostess.yml](https://github.com/mxcl/pkgdb/blob/main/combined/hostess.yml)


## 来源

- pkg.so package database
- Geiger risk classifier
- curated package history
- pkgdb category and tag curation
- external package-manager database matches
- cross-ecosystem install command graph
