# Overview

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

Attach a domain and we hold its DNS zone — which is what lets mail and hosting write what they need. Ownership is proven by the nameservers, not declared.

Status: 8 methods · live extension list · search is free

| Call | Does |
| --- | --- |
| [tlds()](/sdk/ref/domains/tlds) | Extensions currently offered by the connected registrar. |
| [search(query, options)](/sdk/ref/domains/search) | Which names are free. Free, and reserves nothing. |
| [add(name)](/sdk/ref/domains/add) | Attaches it and hands back the nameservers to set. |
| [list()](/sdk/ref/domains/list) | Every attached domain. |
| [get(id)](/sdk/ref/domains/get) | One, by identifier **or by name**. |
| [servers()](/sdk/ref/domains/servers) | What can serve a hostname on this account. |
| [remove(id)](/sdk/ref/domains/remove) | Detaches it. The domain stays the customer's. |
| [expiring(options)](/sdk/ref/domains/expiring) | Which names are near renewal. Read at the registry. |

## Ownership is proven, not declared {#ownership}

> **Until the registrar points at us, the zone serves nothing**
>
> A domain stays pending_nameservers, and attaching a name you do not own gains you nothing. That is the whole proof — there is no verification record to add, and nothing else to do.

A name can be attached once across all accounts. A second attempt answers `domain_taken`, because the second account would overwrite the first one's zone.

## The order that does not break anything {#order}

```javascript
const domain = await api.domains.add("example.com");   // the zone starts EMPTY

const plan = await domain.migration();                 // what does it serve today?
if (!plan.safeToSwitch) await domain.records.import(); // copy it over first

// only now tell the customer to point their registrar at domain.nameservers
await domain.check();                                  // until status is "active"
```

> **A zone starts empty**
>
> Telling a customer to switch their nameservers before copying what the domain served stops their site, their mail and their signature at the same moment. migration() exists to be read before that sentence is written.

## What a zone is for {#what-for}

- [Mail](/sdk/ref/domain/mail/enable) — the records that make an address receive and be trusted.
- [Serving](/sdk/ref/domain/serve) a hostname from something that hosts it.
- [Records](/sdk/ref/domain/records/set) of your own, for anything else.

## One record type is refused {#ns}

`NS`. A record delegating a name away is exactly what a subdomain takeover looks like, so it is not accepted at all.

- [Domain](/sdk/ref/domain): What a domain carries, and what you can do to it.
- [migration()](/sdk/ref/domain/migration): Is switching safe yet?
- [mail.enable()](/sdk/ref/domain/mail/enable): Mail on a domain.

```python
domain = api.domains.add("example.com")      # the zone starts EMPTY

plan = domain.migration()                    # what does it serve today?
if not plan["safeToSwitch"]:
    domain.records.import_zone()             # copy it over first

# only now tell the customer to point their registrar at domain.nameservers
domain.check()                               # until status is "active"
```
