> For the complete documentation index, see [llms.txt](https://book.bsdcn.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://book.bsdcn.org/man/man5/ethers.5.md).

# ethers.5

`ethers` — 以太网地址数据库

## 名称

`ethers`

## 描述

`ethers` 数据库包含有关互联网络上已知主机的 48 位以太网地址的信息。数据存储在名为 **/etc/ethers** 的文件中，格式如下：

> `ethernet-address fully-qualified-host-name`

各项之间由任意数量的空格和/或制表符分隔。行首的 `#` 表示注释开始，注释延续到行尾。行首的 `+` 会使 ethers(3) 库函数除使用 **/etc/ethers** 文件中的数据外，还使用存储在 NIS `ethers.byname` 和 `ethers.byaddr` 映射中的数据。

以太网地址以 ASCII 形式表示为 "x:x:x:x:x:x"，其中 `x` 是 0x00 到 0xFF 之间的十六进制值。地址值应为网络字节序。**/etc/ethers** 数据库中指定的主机名应对应 [hosts(5)](https://github.com/FreeBSD-Ask/freebsd-man-sc/blob/main/man5/hosts.5.md) 文件中的条目。

标准 C 库中的 Fn ether\_line 函数可用于将 **/etc/ethers** 数据库中的各行拆分为各自的组成部分：以 `ether_addr` 结构存储的二进制以太网地址，以及以字符串存储的主机名。

## 文件

**`/etc/ethers`** `ethers` 文件位于 **/etc**。

## 参见

ethers(3), [yp(8)](/man/man8/yp.8.md)

## 历史

`ethers` 格式基于 SunOS 4.1.x 中使用的格式。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://book.bsdcn.org/man/man5/ethers.5.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
