# Overview

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

An attached domain: its state, its records, its mail, and whether switching to us is safe yet.

Status: records, hosting and mail · status is proof

| Member | Does |
| --- | --- |
| [check()](/sdk/ref/domain/check) | Re-reads the zone. This is what moves `status`. |
| [migration()](/sdk/ref/domain/migration) | Would switching now break anything? |
| [serve()](/sdk/ref/domain/serve) · [unserve()](/sdk/ref/domain/unserve) | Make a hostname actually serve. |
| [remove()](/sdk/ref/domain/remove) | Detach it. |
| [records](/sdk/ref/domain/records/list) | `list` · `set` · `remove` · `import`. |
| [mail](/sdk/ref/domain/mail/enable) | `enable` · `status` · `hosts` · `dmarc` · `bimi` · `disable`. |
| [attach()](/sdk/ref/domain/attach) · [attachments()](/sdk/ref/domain/attach) | Put a host of the account behind the name. |
| [redirects](/sdk/ref/domain/redirects) | Send `www` — or the root — somewhere else. |
| [owner()](/sdk/ref/domain/owner) · [tls()](/sdk/ref/domain/tls) | The registry's view, and the certificates. |
| [dnssec](/sdk/ref/domain/dnssec) · [verify()](/sdk/ref/domain/verify) | Sign the zone; prove the domain to a service. |

## What it carries {#properties}

| Name | Type | Requirement | Description |
| --- | --- | --- | --- |
| `name` | string |  | The domain. |
| `status` | string |  | `pending_nameservers` until the registrar points here; `active` after. |
| `nameservers` | string[] |  | What to set at the registrar. **Read them; never hardcode a pair.** |
| `dns` | object |  | `{ mxOk, spfOk, dkimOk, dmarcOk, checkedAt }` — the mail witnesses. |
| `imported` | object |  | `{ found, added, at }` — what the takeover found and copied. |
| `mailHosts` | array |  | Hosts where mail is enabled, each with its selector and its witnesses. |
| `registrar` | string |  | Who registered it. |

## A host, not just a domain {#two-levels}

> **The apex and a subdomain are separate for mail**
>
> Each has its own records, its own key and its own policy — an apex record does not cover a subdomain. mailHosts is a list for that reason, and every mail call takes a subdomain.

## The usual sequence {#sequence}

```javascript
const domain = await api.domains.get("example.com");

await domain.migration();          // safe to switch?
await domain.records.import();     // if not
await domain.check();              // until status is "active"
await domain.mail.enable();        // then mail
```

- [migration()](/sdk/ref/domain/migration): Is switching safe yet?
- [records.set()](/sdk/ref/domain/records/set): Writing a record.
- [mail.enable()](/sdk/ref/domain/mail/enable): Mail in one call.

```python
domain = api.domains.get("example.com")

domain.migration()            # safe to switch?
domain.records.import_zone()  # if not
domain.check()                # until status is "active"
domain.mail.enable()          # then mail
```
