# 使用 Homebrew, apk, dnf, MacPorts, Nix, pacman, apt, zypper 安装 c-ares

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

## 安装

```sh
sudo av install brew:c-ares
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install c-ares
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install c-ares
```

  证据: MacPorts ports tree: net/c-ares/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1

### Linux

- apk (92%):

```sh
sudo apk add c-ares
```

  证据: Alpine Linux edge package indexes: c-ares from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz

- dnf (92%):

```sh
sudo dnf install c-ares
```

  证据: Fedora Rawhide package metadata: c-ares from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst

- Nix (92%):

```sh
nix profile install nixpkgs#c-ares
```

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

- pacman (92%):

```sh
sudo pacman -S c-ares
```

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

- Debian apt (92%):

```sh
sudo apt install libc-ares-dev
```

  证据: Debian stable package indexes: libc-ares-dev from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz

- zypper (92%):

```sh
sudo zypper install c-ares-devel
```

  证据: openSUSE Tumbleweed package metadata: c-ares-devel from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst

## 软件包事实

- **软件包键:** brew:c-ares
- **软件包管理器:** Homebrew
- **版本:** 1.34.8
- **来源摘要:** Asynchronous DNS library
- **主页:** <https://c-ares.org/>
- **仓库:** <https://github.com/c-ares/c-ares>
- **最后更新:** 2026-07-08T02:31:43Z
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- adig (别名)
- ahost (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

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

c-ares is an MIT-licensed C library for asynchronous DNS resolution. It grew out of Daniel Stenberg's search for a non-blocking resolver suitable for libcurl and became a long-lived dependency for network software that cannot afford blocking name lookups.

### 项目历史

The official `why` page explains that Daniel Stenberg looked for an asynchronous DNS resolver for libcurl, found the older ares library, began expanding it, and forked when the original author would not accept the needed changes. That fork became c-ares.

The project still acknowledges ares as the public API influence while noting that the code no longer closely resembles the original. Its README now describes c-ares as a modern DNS stub resolver written in C with asynchronous interfaces, portability across Unix, Windows, mobile, and other systems, and active maintenance after more than 20 years.

Recent project materials emphasize security practice as much as asynchronous lookup: safe parsers and builders, static and dynamic analysis, OSS-Fuzz coverage, signed releases, and SLSA provenance for release artifacts.

### 采用历史

c-ares adoption started from libcurl's need for DNS lookups that could integrate with event-driven network code. From there it spread into software that needs many DNS queries in parallel or wants resolver behavior independent from a platform's blocking libc calls.

Its package-manager footprint is broad: Homebrew, Debian and Ubuntu development packages, Fedora, Alpine, Arch, MacPorts, Nix, and openSUSE all package it. That breadth reflects its status as a library dependency more than an end-user command, although tools such as `adig` and `ahost` are installed with some packages.

### 使用方式

Developers link against c-ares to issue asynchronous DNS queries through non-blocking sockets and integrate DNS work into event loops. The official docs include initialization APIs such as `ares_init_options` and resolver configuration behavior.

On Unix-like systems c-ares reads resolver environment from standard system files such as `/etc/resolv.conf` and `/etc/hosts`, matching the package's curated config-file locations.

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

c-ares is one of those packages users may never invoke directly but build systems constantly care about. It is a small C library whose ABI, headers, pkg-config metadata, and security updates affect curl-like networking stacks across distributions.

For package nerds, it is also a clean example of a library fork becoming infrastructure: born from a specific libcurl need, preserved for API/ABI stability, and now maintained with modern supply-chain signals such as signed releases and SLSA provenance.

### 时间线

- Early 2000s: Daniel Stenberg searches for an asynchronous DNS resolver for libcurl and forks from ares to create c-ares.
- 2004: Early tags such as `c-ares-1_2_0` appear in the upstream repository history.
- 2010s: c-ares remains a common packaged dependency for asynchronous DNS in C networking software.
- 2024: The project site describes more than 20 years of active maintenance and modern DNS RFC support.
- 2025: The official site publishes c-ares 1.34.6 as a signed release with release provenance.

### Related projects

- libcurl is the motivating user described by the official history page.
- ares is the older resolver library from which c-ares forked.
- ADNS, UDNS, FireDNS, Mozilla netlib, djbdns, and other resolver libraries are discussed by the c-ares project as alternatives or contemporaries.

### 来源

- <https://c-ares.org/>
- <https://c-ares.org/why.html>
- <https://github.com/c-ares/c-ares/blob/main/README.md>
- <https://github.com/c-ares/c-ares/tags>
- source_facts.package-manager


## 安全说明

broad file, network, media, or database tool signal.

- **Geiger 风险:** blue / 中
- broad file, network, media, or database tool signal


## Configuration and credential file locations

These source-backed paths show where this package keeps local settings or durable credentials. Automic Vault can use them as review targets for secret scanning, migration, and command approval.


## Configuration files

- Unix: /etc/resolv.conf, /etc/hosts
## 其他软件包管理器记录

- Debian apt - libc-ares-dev - 1.34.5-1+deb13u1: normalized package name match | Debian stable package indexes: libc-ares-dev from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | asynchronous name resolver - development files | https://c-ares.org/
- Debian apt - libc-ares2 - 1.34.5-1+deb13u1: normalized package name match | Debian stable package indexes: libc-ares2 from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | transitional package | https://c-ares.org/
- Debian apt - libcares2 - 1.34.5-1+deb13u1: normalized package name match | Debian stable package indexes: libcares2 from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | asynchronous name resolver | https://c-ares.org/
- Nix - c-ares: normalized package name match | nixpkgs package indexes: pkgs/by-name/c-/c-ares/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- Ubuntu apt - libc-ares-dev - 1.27.0-1.0ubuntu1: normalized package name match | Ubuntu 24.04 LTS package indexes: libc-ares-dev from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz | asynchronous name resolver - development files | https://c-ares.org/
- Ubuntu apt - libcares2 - 1.27.0-1.0ubuntu1: normalized package name match | Ubuntu 24.04 LTS package indexes: libcares2 from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz | asynchronous name resolver | https://c-ares.org/
- apk - c-ares - 1.34.8-r0: normalized package name match | Alpine Linux edge package indexes: c-ares from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | Asynchronous DNS/names resolver library | https://c-ares.org/
- apk - c-ares-dev - 1.34.8-r0: normalized package name match | Alpine Linux edge package indexes: c-ares-dev from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | Asynchronous DNS/names resolver library (development files) | https://c-ares.org/
- apk - c-ares-doc - 1.34.8-r0: normalized package name match | Alpine Linux edge package indexes: c-ares-doc from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | Asynchronous DNS/names resolver library (documentation) | https://c-ares.org/
- apk - c-ares-utils - 1.34.8-r0: normalized package name match | Alpine Linux edge package indexes: c-ares-utils from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | Asynchronous DNS/names resolver library | https://c-ares.org/
- dnf - c-ares - 1.34.8-2.fc45: normalized package name match | Fedora Rawhide package metadata: c-ares from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | A library that performs asynchronous DNS operations | http://c-ares.org/
- dnf - c-ares-devel - 1.34.8-2.fc45: normalized package name match | Fedora Rawhide package metadata: c-ares-devel from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | Development files for c-ares | http://c-ares.org/
- pacman - c-ares - 1.34.8-1: normalized package name match | Arch Linux sync databases: c-ares from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz | A C library for asynchronous DNS requests | https://c-ares.org/
- zypper - c-ares-devel - 1.34.6-1.5: normalized package name match | openSUSE Tumbleweed package metadata: c-ares-devel from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | Development files for c-ares | https://c-ares.org/
- zypper - c-ares-utils - 1.34.6-1.5: normalized package name match | openSUSE Tumbleweed package metadata: c-ares-utils from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | Tools for asynchronous name resolves | https://c-ares.org/
- zypper - libcares2 - 1.34.6-1.5: normalized package name match | openSUSE Tumbleweed package metadata: libcares2 from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | Library for asynchronous name resolves | https://c-ares.org/


## Combined YAML source

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


## 来源

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