c-ares/c-ares
FreeA C library for asynchronous DNS requests
About c-ares/c-ares
c-ares is a modern DNS (stub) resolver library written in C that provides asynchronous query interfaces while abstracting the complexities of the underlying DNS protocol. Originally designed for applications needing non-blocking DNS lookups or parallel queries, it aims to serve as a better DNS resolver than those provided by the operating system. The library is MIT licensed, builds with any C89 compiler, and runs on Linux, FreeBSD, OpenBSD, macOS, Solaris, AIX, Windows, Android, iOS, and many other platforms. It emphasizes security with safe parsers and data builders, and is continuously validated through static/dynamic analysis and OSS Fuzz. Actively maintained for over 20 years, c-ares follows the latest DNS RFCs and modern C coding standards.
Key Features
Pros & Cons
- Asynchronous design avoids blocking the calling application
- Portable across many operating systems and compilers
- MIT license allows use in both free and commercial software
- Strong security practices reduce vulnerability to common DNS attacks
- Well-maintained with decades of development and testing
- Stub resolver only, not a full recursive DNS server
- Requires integration into C/C++ codebase; no built-in scripting interface
- Memory management is manual, as typical for C libraries