> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nextdns.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Legacy TLD blocking

> How the deprecated security.tlds field maps to entries in the Denylist.

Use the [Denylist](https://docs.nextdns.io/api-reference/profiles/domain-lists.md) to block a top-level domain such as `.zip`. Existing clients can still read and write `security.tlds`. It shows the active Denylist entries whose IDs appear in the legacy TLD catalog. The catalog at `GET /security/tlds` and its historical `spamhaus` scores were frozen on November 23, 2026. These endpoints have no scheduled removal date.

## Read the selection

```bash theme={null}
curl "https://api.nextdns.io/profiles/$PROFILE_ID/security/tlds" \
  -H "X-Api-Key: $NEXTDNS_API_KEY"
```

```json theme={null}
{ "data": [{ "id": "zip" }] }
```

## Update the selection

The paths below are relative to `/profiles/{profile}/security/tlds`. Successful writes return `204 No Content`. Adding a new entry uses one of the Denylist's 5,000 slots. Reactivating an existing entry also works when the list is full.

| Request | Effect |
| - | - |
| `POST` with `{"id":"zip"}` | Adds or reactivates the `zip` Denylist entry. An already active entry returns HTTP `400` with `duplicate`. |
| `DELETE /zip` | Removes the active `zip` entry. An inactive or absent entry returns `404`. |
| `PUT` with `[{"id":"zip"}]` | Replaces the active catalog selection. Any omitted active catalog TLD is removed. Other domains and unselected inactive entries stay in place. |

The legacy endpoints only accept TLDs in the frozen catalog. Use the Denylist directly for other TLDs. Sending `[]` to this legacy `PUT` removes all active catalog TLDs. Sending `[]` to `PUT /profiles/{profile}/denylist` clears the entire Denylist.

## Import older profiles

When you create a profile with `POST /profiles`, NextDNS merges `security.tlds` into `denylist`. A TLD in both arrays becomes active.

When updating a profile with `PATCH /profiles/{profile}`, send only the field you want to change. If you send both arrays, make `security.tlds` match the active catalog TLDs in `denylist`, in any order, to avoid HTTP `400` with `conflictingTldValues`.

The separate `security.highRiskTlds` setting controls automatic High-Risk TLD protection.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.