# list()

Canonical URL: https://developers.iagenify.com/sdk/ref/domains/list/
Language: en

`api.domains.list() → Promise<Domain[]>`

Every attached domain, each one a full Domain object with its records and its mail.

Status: GET /api/domains · free · Domain objects

```javascript
for (const domain of await api.domains.list()) {
  console.log(domain.name, domain.status, domain.mailHosts.length, "mail hosts");
}
```

## status is the thing to show {#status}

| status | Means |
| --- | --- |
| `pending_nameservers` | The registrar does not point here yet. The zone serves nothing. |
| `active` | It does. Everything in the zone is live. |

It is refreshed by [check()](/sdk/ref/domain/check), not by listing — a list shows what was last known.

## dns carries the mail witnesses {#witnesses}

```javascript
domain.dns;   // { mxOk, spfOk, dkimOk, dmarcOk, checkedAt }
```

Four booleans saying what the zone actually holds for mail. All four true is what « it works » means here.

## Pending domains are worth separating {#pending}

```javascript
const waiting = (await api.domains.list()).filter((d) => d.status === "pending_nameservers");
```

A domain that has been pending for days usually means the customer never made the change — which nothing else will tell you.

- [get()](/sdk/ref/domains/get): One, by name.
- [Domain](/sdk/ref/domain): What a domain carries, and what you can do to it.

```python
for domain in api.domains.list():
    print(domain.name, domain.status, len(domain.mail_hosts), "mail hosts")
```

```python
domain.dns   # {"mxOk", "spfOk", "dkimOk", "dmarcOk", "checkedAt"}
```

```python
waiting = [d for d in api.domains.list() if d.status == "pending_nameservers"]
```
