• Home
Name Date Size #Lines LOC

..--

cmake/22-Oct-2025-438382

docs/22-Oct-2025-7,7926,577

include/22-Oct-2025-4,5192,383

src/22-Oct-2025-50,48634,143

test/22-Oct-2025-19,75515,533

.gitattributesD22-Oct-2025631 1615

AUTHORSD22-Oct-20251.2 KiB8583

BUILD.gnD22-Oct-20255.8 KiB243228

CMakeLists.txtD22-Oct-202537.5 KiB906790

CONTRIBUTING.mdD22-Oct-2025369 107

DEVELOPER-NOTES.mdD22-Oct-20252.6 KiB4837

INSTALL.mdD22-Oct-202515 KiB473337

LICENSE.mdD22-Oct-20251.2 KiB2520

Makefile.WatcomD22-Oct-20255.8 KiB244182

Makefile.amD22-Oct-20252.4 KiB6623

Makefile.djD22-Oct-20253.5 KiB15093

Makefile.inD22-Oct-202531.9 KiB985851

Makefile.m32D22-Oct-20252.2 KiB8249

Makefile.msvcD22-Oct-202516 KiB473275

Makefile.netwareD22-Oct-202514 KiB431359

OAT.xmlD22-Oct-20256.2 KiB9138

README.OpenSourceD22-Oct-2025306 1211

README.mdD22-Oct-20257.7 KiB159130

README.msvcD22-Oct-20253.6 KiB10362

RELEASE-NOTES.mdD22-Oct-20251 KiB2921

SECURITY.mdD22-Oct-20254.4 KiB10174

aclocal.m4D22-Oct-202544.9 KiB1,2491,136

aminclude_static.amD22-Oct-20256.6 KiB127108

buildconfD22-Oct-2025211 72

buildconf.batD22-Oct-2025646 2419

bundle.jsonD22-Oct-20251.3 KiB4948

c-ares-config.cmake.inD22-Oct-2025886 2821

configureD22-Oct-2025819.3 KiB28,44823,882

configure.acD22-Oct-202533.9 KiB880789

install.shD22-Oct-2025817 3212

libcares.pc.cmakeD22-Oct-2025775 2422

libcares.pc.inD22-Oct-2025672 2321

README.OpenSource

1[
2    {
3    "Name": "c-ares",
4    "License": "MIT License",
5    "License File": "LICENSE.md",
6    "Version Number": "cares-1_34_5",
7    "Owner": "heqianmo@huawei.com",
8    "Upstream URL": "https://gitee.com/c-ares/c-ares",
9    "Description": "A C library for asynchronous DNS requests."
10    }
11]
12

README.md

1# [![c-ares logo](https://c-ares.org/art/c-ares-logo.svg)](https://c-ares.org/)
2
3[![Build Status](https://api.cirrus-ci.com/github/c-ares/c-ares.svg?branch=main)](https://cirrus-ci.com/github/c-ares/c-ares)
4[![Windows Build Status](https://ci.appveyor.com/api/projects/status/aevgc5914tm72pvs/branch/main?svg=true)](https://ci.appveyor.com/project/c-ares/c-ares/branch/main)
5[![Coverage Status](https://coveralls.io/repos/github/c-ares/c-ares/badge.svg?branch=main)](https://coveralls.io/github/c-ares/c-ares?branch=main)
6[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/291/badge)](https://bestpractices.coreinfrastructure.org/projects/291)
7[![Fuzzing Status](https://oss-fuzz-build-logs.storage.googleapis.com/badges/c-ares.svg)](https://bugs.chromium.org/p/oss-fuzz/issues/list?sort=-opened&can=1&q=proj:c-ares)
8[![Bugs](https://sonarcloud.io/api/project_badges/measure?project=c-ares_c-ares&metric=bugs)](https://sonarcloud.io/summary/new_code?id=c-ares_c-ares)
9[![Coverity Scan Status](https://scan.coverity.com/projects/c-ares/badge.svg)](https://scan.coverity.com/projects/c-ares)
10
11- [Overview](#overview)
12- [Code](#code)
13- [Communication](#communication)
14- [Release Keys](#release-keys)
15  - [Verifying signatures](#verifying-signatures)
16- [Features](#features)
17  - [RFCs and Proposals](#supported-rfcs-and-proposals)
18
19## Overview
20[c-ares](https://c-ares.org) is a modern DNS (stub) resolver library, written in
21C. It provides interfaces for asynchronous queries while trying to abstract the
22intricacies of the underlying DNS protocol.  It was originally intended for
23applications which need to perform DNS queries without blocking, or need to
24perform multiple DNS queries in parallel.
25
26One of the goals of c-ares is to be a better DNS resolver than is provided by
27your system, regardless of which system you use.  We recommend using
28the c-ares library in all network applications even if the initial goal of
29asynchronous resolution is not necessary to your application.
30
31c-ares will build with any C89 compiler and is [MIT licensed](LICENSE.md),
32which makes it suitable for both free and commercial software. c-ares runs on
33Linux, FreeBSD, OpenBSD, MacOS, Solaris, AIX, Windows, Android, iOS and many
34more operating systems.
35
36c-ares has a strong focus on security, implementing safe parsers and data
37builders used throughout the code, thus avoiding many of the common pitfalls
38of other C libraries.  Through automated testing with our extensive testing
39framework, c-ares is constantly validated with a range of static and dynamic
40analyzers, as well as being constantly fuzzed by [OSS Fuzz](https://github.com/google/oss-fuzz).
41
42While c-ares has been around for over 20 years, it has been actively maintained
43both in regards to the latest DNS RFCs as well as updated to follow the latest
44best practices in regards to C coding standards.
45
46## Code
47
48The full source code and revision history is available in our
49[GitHub  repository](https://github.com/c-ares/c-ares).  Our signed releases
50are available in the [release archives](https://c-ares.org/download/).
51
52
53See the [INSTALL.md](INSTALL.md) file for build information.
54
55## Communication
56
57**Issues** and **Feature Requests** should be reported to our
58[GitHub Issues](https://github.com/c-ares/c-ares/issues) page.
59
60**Discussions** around c-ares and its use, are held on
61[GitHub Discussions](https://github.com/c-ares/c-ares/discussions/categories/q-a)
62or the [Mailing List](https://lists.haxx.se/mailman/listinfo/c-ares).  Mailing
63List archive [here](https://lists.haxx.se/pipermail/c-ares/).
64Please, do not mail volunteers privately about c-ares.
65
66**Security vulnerabilities** are treated according to our
67[Security Procedure](SECURITY.md), please email c-ares-security at
68 haxx.se if you suspect one.
69
70
71## Release keys
72
73Primary GPG keys for c-ares Releasers (some Releasers sign with subkeys):
74
75* **Daniel Stenberg** <<daniel@haxx.se>>
76  `27EDEAF22F3ABCEB50DB9A125CC908FDB71E12C2`
77* **Brad House** <<brad@brad-house.com>>
78  `DA7D64E4C82C6294CB73A20E22E3D13B5411B7CA`
79
80To import the full set of trusted release keys (including subkeys possibly used
81to sign releases):
82
83```bash
84gpg --keyserver hkps://keyserver.ubuntu.com --recv-keys 27EDEAF22F3ABCEB50DB9A125CC908FDB71E12C2 # Daniel Stenberg
85gpg --keyserver hkps://keyserver.ubuntu.com --recv-keys DA7D64E4C82C6294CB73A20E22E3D13B5411B7CA # Brad House
86```
87
88### Verifying signatures
89
90For each release `c-ares-X.Y.Z.tar.gz` there is a corresponding
91`c-ares-X.Y.Z.tar.gz.asc` file which contains the detached signature for the
92release.
93
94After fetching all of the possible valid signing keys and loading into your
95keychain as per the prior section, you can simply run the command below on
96the downloaded package and detached signature:
97
98```bash
99% gpg -v --verify c-ares-1.29.0.tar.gz.asc c-ares-1.29.0.tar.gz
100gpg: enabled compatibility flags:
101gpg: Signature made Fri May 24 02:50:38 2024 EDT
102gpg:                using RSA key 27EDEAF22F3ABCEB50DB9A125CC908FDB71E12C2
103gpg: using pgp trust model
104gpg: Good signature from "Daniel Stenberg <daniel@haxx.se>" [unknown]
105gpg: WARNING: This key is not certified with a trusted signature!
106gpg:          There is no indication that the signature belongs to the owner.
107Primary key fingerprint: 27ED EAF2 2F3A BCEB 50DB  9A12 5CC9 08FD B71E 12C2
108gpg: binary signature, digest algorithm SHA512, key algorithm rsa2048
109```
110
111## Features
112
113See [Features](FEATURES.md)
114
115### Supported RFCs and Proposals
116- [RFC1035](https://datatracker.ietf.org/doc/html/rfc1035).
117  Initial/Base DNS RFC
118- [RFC2671](https://datatracker.ietf.org/doc/html/rfc2671),
119  [RFC6891](https://datatracker.ietf.org/doc/html/rfc6891).
120  EDNS0 option (meta-RR)
121- [RFC3596](https://datatracker.ietf.org/doc/html/rfc3596).
122  IPv6 Address. `AAAA` Record.
123- [RFC2782](https://datatracker.ietf.org/doc/html/rfc2782).
124  Server Selection. `SRV` Record.
125- [RFC3403](https://datatracker.ietf.org/doc/html/rfc3403).
126  Naming Authority Pointer. `NAPTR` Record.
127- [RFC6698](https://datatracker.ietf.org/doc/html/rfc6698).
128  DNS-Based Authentication of Named Entities (DANE) Transport Layer Security (TLS) Protocol.
129  `TLSA` Record.
130- [RFC9460](https://datatracker.ietf.org/doc/html/rfc9460).
131  General Purpose Service Binding, Service Binding type for use with HTTPS.
132  `SVCB` and `HTTPS` Records.
133- [RFC7553](https://datatracker.ietf.org/doc/html/rfc7553).
134  Uniform Resource Identifier. `URI` Record.
135- [RFC6844](https://datatracker.ietf.org/doc/html/rfc6844).
136  Certification Authority Authorization. `CAA` Record.
137- [RFC2535](https://datatracker.ietf.org/doc/html/rfc2535),
138  [RFC2931](https://datatracker.ietf.org/doc/html/rfc2931).
139  `SIG0` Record. Only basic parser, not full implementation.
140- [RFC7873](https://datatracker.ietf.org/doc/html/rfc7873),
141  [RFC9018](https://datatracker.ietf.org/doc/html/rfc9018).
142  DNS Cookie off-path dns poisoning and amplification mitigation.
143- [draft-vixie-dnsext-dns0x20-00](https://datatracker.ietf.org/doc/html/draft-vixie-dnsext-dns0x20-00).
144  DNS 0x20 query name case randomization to prevent cache poisioning attacks.
145- [RFC7686](https://datatracker.ietf.org/doc/html/rfc7686).
146  Reject queries for `.onion` domain names with `NXDOMAIN`.
147- [RFC2606](https://datatracker.ietf.org/doc/html/rfc2606),
148  [RFC6761](https://datatracker.ietf.org/doc/html/rfc6761).
149  Special case treatment for `localhost`/`.localhost`.
150- [RFC2308](https://datatracker.ietf.org/doc/html/rfc2308),
151  [RFC9520](https://datatracker.ietf.org/doc/html/rfc9520).
152  Negative Caching of DNS Resolution Failures.
153- [RFC6724](https://datatracker.ietf.org/doc/html/rfc6724).
154  IPv6 address sorting as used by `ares_getaddrinfo()`.
155- [RFC7413](https://datatracker.ietf.org/doc/html/rfc7413).
156  TCP FastOpen (TFO) for 0-RTT TCP Connection Resumption.
157- [RFC3986](https://datatracker.ietf.org/doc/html/rfc3986).
158  Uniform Resource Identifier (URI). Used for server configuration.
159

README.msvc

1
2
3                          ___       __ _ _ __ ___  ___
4                         / __| ___ / _` | '__/ _ \/ __|
5                        | (_  |___| (_| | | |  __/\__ \
6                         \___|     \__,_|_|  \___||___/
7
8
9                How to build c-ares using MSVC or Visual Studio
10               =================================================
11
12
13
14  How to build using MSVC from the command line
15  ---------------------------------------------
16
17  Open a command prompt window and ensure that the environment is properly
18  set up in order to use MSVC or Visual Studio compiler tools.
19
20  Change to c-ares source folder where Makefile.msvc file is located and run:
21
22  > nmake -f Makefile.msvc
23
24  This will build all c-ares libraries as well as three sample programs.
25
26  Once the above command has finished a new folder named MSVCXX will exist
27  below the folder where makefile.msvc is found. The name of the folder
28  depends on the MSVC compiler version being used to build c-ares.
29
30  Below the MSVCXX folder there will exist four folders named 'cares',
31  'ahost', and 'adig'. The 'cares' folder is the one that
32  holds the c-ares libraries you have just generated, the other three
33  hold sample programs that use the libraries.
34
35  The above command builds four versions of the c-ares library, dynamic
36  and static versions and each one in release and debug flavours. Each
37  of these is found in folders named dll-release, dll-debug, lib-release,
38  and lib-debug, which hang from the 'cares' folder mentioned above. Each
39  sample program also has folders with the same names to reflect which
40  library version it is using.
41
42
43  How to install using MSVC from the command line
44  -----------------------------------------------
45
46  In order to allow easy usage of c-ares libraries it may be convenient to
47  install c-ares libraries and header files to a common subdirectory tree.
48
49  Once that c-ares libraries have been built using procedure described above,
50  use same command prompt window to define environment variable INSTALL_DIR
51  to designate the top subdirectory where installation of c-ares libraries and
52  header files will be done.
53
54  > set INSTALL_DIR=c:\c-ares
55
56  Afterwards, run following command to actually perform the installation:
57
58  > nmake -f Makefile.msvc install
59
60  Installation procedure will copy c-ares libraries to subdirectory 'lib' and
61  c-ares header files to subdirectory 'include' below the INSTALL_DIR subdir.
62
63  When environment variable INSTALL_DIR is not defined, installation is done
64  to c-ares source folder where Makefile.msvc file is located.
65
66
67
68  Relationship between c-ares library file names and versions
69  -----------------------------------------------------------
70
71  c-ares static release library version files:
72
73      libcares.lib -> static release library
74
75  c-ares static debug library version files:
76
77      libcaresd.lib -> static debug library
78
79  c-ares dynamic release library version files:
80
81      cares.dll -> dynamic release library
82      cares.lib -> import library for the dynamic release library
83      cares.exp -> export file for the dynamic release library
84
85  c-ares dynamic debug library version files:
86
87      caresd.dll -> dynamic debug library
88      caresd.lib -> import library for the dynamic debug library
89      caresd.exp -> export file for the dynamic debug library
90      caresd.pdb -> debug symbol file for the dynamic debug library
91
92
93  How to use c-ares static libraries
94  ----------------------------------
95
96  When using the c-ares static library in your program, you will have to
97  define preprocessor symbol CARES_STATICLIB while building your program,
98  otherwise you will get errors at linkage stage.
99
100
101Have Fun!
102
103