# dns

Canonical URL: https://developers.iagenify.com/sdk/agent/permissions/categories/dns/
Language: en

Writing in a domain's zone. Asked even in auto, and « always » is remembered for that domain alone — because one wrong record takes down a site and its mail together.

Status: asked even in auto · always is per domain · one record, two outages

| ask | auto | plan | full |
| --- | --- | --- | --- |
| asked | asked | refused | allowed |

## The tool {#tool}

`domain`, on every action that is not a read. Its reads — searching, listing, checking, reading records, reading the mail status, the migration comparison — are [read](/sdk/agent/permissions/categories/read) and free.

| Reads (free) | Writes (asked) |
| --- | --- |
| `search` · `list` · `get` · `check` | `add` · `remove` |
| `migration` · `records` | `set_record` · `remove_record` · `import` |
| `mail_status` · `servers` | `mail_enable` · `mail_disable` · `serve` |

## Why it has its own category {#why}

> **A record is not a file and not a row**
>
> An MX pointed at the wrong host stops mail arriving without anything appearing broken; an A record moved stops a site. Both are changes to what the rest of the internet believes, and neither has a previous version to restore.

## « always » is for that domain {#per-domain}

```javascript
onPermission: async ({ category, args }) => {
  if (category !== "dns") return "once";
  if (args.domain === "staging.example.com") return "always";
  return "deny";                       // every other zone stays asked
}
```

Approving one zone never approves another, and the memory lasts for the session only. There is no durable DNS allow list.

## What the service refuses whatever you answer {#refusals}

- An `NS` record — it would delegate a name away, and a subdomain takeover is exactly that.
- A record name that would leave the zone: names are always relative to it.
- Replacing live mail records without asking for it explicitly: that comes back as a refusal naming where the mail currently goes.

- [domain](/sdk/agent/tools/domain): The tool and its actions.
- [Domain](/sdk/ref/domain): Doing it yourself.

```python
def on_permission(request):
    if request["category"] != "dns":
        return "once"
    if request["args"].get("domain") == "staging.example.com":
        return "always"
    return "deny"          # every other zone stays asked
```
