# unserve()

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

`domain.unserve({ name, pages }) → Promise<Result>`

Removes both halves: the registration with the platform, and the DNS record.

Status: both halves · tells you which · no undo

```javascript
const result = await domain.unserve({ name: "docs", pages: "…" });
// { hostname, unbound: true, recordRemoved: true }
```

## Two flags, because there are two halves {#two-flags}

| Field | Says |
| --- | --- |
| `unbound` | The platform no longer accepts the name. |
| `recordRemoved` | The DNS record is gone. |

> **One of them false is worth noticing**
>
> A record removed but the name still registered leaves a dangling registration; a name unbound but the record still there leaves an address that resolves and refuses. The flags say which happened rather than reporting a single success.

## The order it does them in {#order}

The registration, then the record. A name that stops resolving while still registered is invisible; one that resolves while refusing looks broken.

## It takes effect as DNS allows {#immediate}

Resolvers hold a record for its lifetime. The address can keep answering briefly after this returns — which is DNS, not a failure of the call.

- [serve()](/sdk/ref/domain/serve): The other direction.
- [records.remove()](/sdk/ref/domain/records/remove): Removing a record alone.

```python
result = domain.unserve(name="docs", pages="…")
# {"hostname", "unbound": True, "recordRemoved": True}
```
