---
name: "ares_reinit"
section: "3"
platform: "linux"
package: "c-ares"
version: "1.34.9-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/ares_reinit"
---

# ares\_reinit(3)

ReInitialize a resolver channel from system configuration.

## NAME

ares\_reinit - ReInitialize a resolver channel from system configuration.

## SYNOPSIS

```
#include <ares.h>
int ares_reinit(ares_channel_t *channel)
```

## DESCRIPTION

The **[ares\_reinit(3)](/ares_reinit/3.md)** function re-reads the system configuration and safely applies the configuration to the existing channel.  System configuration will never override user-provided settings such as provided via **[ares\_init\_options(3)](/ares_init_options/3.md)** or **[ares\_set\_servers(3)](/ares_set_servers/3.md)**.

Any existing queries will be automatically requeued if the server they are currently assigned to is removed from the system configuration.

This function may cause additional file descriptors to be created, and existing ones to be destroyed if server configuration has changed.

d safety, will spawn a background thread to read the configuration and apply it.  It is crucial that developers use the **ARES\_OPT\_SOCK\_STATE\_CB** or **ARES\_OPT\_EVENT\_THREAD** so that notifications of changes are alerted.  If using **[ares\_getsock(3)](/ares_getsock/3.md)** or **[ares\_fds(3)](/ares_fds/3.md)**, no notification is possible which could cause a stall.

## RETURN VALUES

*[ares\_reinit(3)](/ares_reinit/3.md)* can return any of the following values:

- **ARES\_SUCCESS**

  Initialization succeeded.

- **ARES\_EFILE**

  A configuration file could not be read.

- **ARES\_ENOMEM**

  The process's available memory was exhausted.

## AVAILABILITY

This function was first introduced in c-ares version 1.22.0.

## SEE ALSO

[**ares\_init**(3)](/ares_init/3.md), [**ares\_init\_options**(3)](/ares_init_options/3.md), [**ares\_destroy**(3)](/ares_destroy/3.md), [**ares\_dup**(3)](/ares_dup/3.md), [**ares\_library\_init**(3)](/ares_library_init/3.md), [**ares\_set\_servers**(3)](/ares_set_servers/3.md), [**ares\_threadsafety**(3)](/ares_threadsafety/3.md)
