# mail.hosts()

Canonical URL: https://developers.iagenify.com/sdk/ref/domain/mail/hosts/
Language: en

`domain.mail.hosts() → Promise<Host[]>`

Every host on this domain where mail is enabled, with its witnesses, its selector and how many mailboxes it carries.

Status: free · apex and subdomains · mailbox counts

```javascript
for (const host of await domain.mail.hosts()) {
  console.log(host.host, host.ready ? "ready" : "incomplete", host.mailboxes, "mailboxes");
}
```

| Name | Type | Requirement | Description |
| --- | --- | --- | --- |
| `host` | string |  | The full hostname — the apex, or a subdomain. |
| `selector` | string |  | The signing key's selector. |
| `mxOk · spfOk · dkimOk · dmarcOk` | boolean |  | The four witnesses. |
| `ready` | boolean |  | All four, and the domain active. |
| `mailboxes` | integer |  | How many addresses exist on it. |
| `enabledAt` | string |  | When it was configured. |

## Why there can be several {#why-list}

> **Mail is configured per host, not per domain**
>
> An apex that already receives elsewhere, a subdomain for the team, another for notifications — each has its own records, its own key and its own policy. A policy on the apex does not cover a subdomain.

## mailboxes is what makes a host hard to remove {#mailboxes}

Disabling a host with mailboxes on it stops those addresses receiving. The count is here so that can be said before it happens.

## A host that is not ready {#incomplete}

Call [enable()](/sdk/ref/domain/mail/enable) again on it: it poses what is missing and changes nothing else.

- [mail.status()](/sdk/ref/domain/mail/status): One host in detail.
- [api.mail](/sdk/ref/mail): The mailboxes themselves.

```python
for host in domain.mail.hosts():
    print(host["host"], "ready" if host["ready"] else "incomplete", host["mailboxes"], "mailboxes")
```
