# serve()

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

`domain.serve({ name, pages }) → Promise<Served>`

Fa un nome d'host realmente servir: scrive il record e registra il nome con la piattaforma che risponde. Ambas metàs, insieme.

Status: both halves · pages from servers() · a record alone is not enough

```javascript
const servers = await api.domains.servers();

const served = await domain.serve({ name: "docs", pages: servers[0].name });
// { hostname, target, project, status, certificate, note }
```

| Name | Type | Requirement | Description |
| --- | --- | --- | --- |
| `name` | string | obrigatório | Il nome host, in rapporto alla zona — `docs`, `www`. |
| `pages` | string | obrigatório | Lo che lo servirà, da [servitori()](/pt/sdk/ref/domains/servers). |

## Por què è un appello {#why}

> **Un record DNS non fa che un nome d'host serve ningun**
>
> La piattaforma d'altre estrems deve riconoscere il nome, o il suo bordo nega la connezione — che l'escrivi ca un apagn. Scrivendo il record solo è l'errore que il appell existe per prevenire.

## Il certificate dure un moment {#certificate}

`certificate` torna come suo stato. Fino a che il connecttion è attiva falls — a attente, non un defecto. Verificalo prima di dire a qualcuno l'indirizzo funcionà.

## Per un host creata qui, usa il host {#hosting}

[host.domains.attach()](/pt/sdk/ref/host/domains/attach) é aquele para algo hospedado em IaGenify. Este é para servir un nome de algo diferente sobre o compte.

## Disfalo {#removing}

[unserve()](/pt/sdk/ref/domain/unserve) elimina entrambe le metàs — l'inregistrazione e l'archive.

- [unserve()](/pt/sdk/ref/domain/unserve): Retirando-o.
- [servers()](/pt/sdk/ref/domains/servers): Ce sa servit.

```python
servers = api.domains.servers()

served = domain.serve(name="docs", pages=servers[0]["name"])
# {"hostname", "target", "project", "status", "certificate", "note"}
```
