# Update DNS Zone (Full Replace) — IONOS Hosting Services

> Replace ALL records in a DNS zone with the provided record set (HTTP PUT / full zone overwrite). Any existing record not present in the payload is permanently removed. For a partial update that only replaces records sharing the same name…

- Key: `ionos_hosting_services-update-dns-zone`
- Type: Action (Write)
- Version: 0.0.2
- App: IONOS Hosting Services (`ionos_hosting_services`) — https://pipedream.com/apps/ionos-hosting-services.md
- This page (HTML): https://pipedream.com/apps/ionos-hosting-services/actions/update-dns-zone
- Hints: destructive · open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/ionos_hosting_services/actions/update-dns-zone/update-dns-zone.mjs

## Description

Replace ALL records in a DNS zone with the provided record set (HTTP PUT / full zone overwrite). Any existing record not present in the payload is permanently removed. For a partial update that only replaces records sharing the same name and type, use **Patch DNS Zone** instead. Run **List DNS Zones** to find the zone ID and **Get DNS Zone** to inspect current records first. [See the documentation](https://developer.hosting.ionos.com/docs/dns).

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `zoneId` | `string` | Yes | The DNS zone ID (UUID format, e.g. 4ab3a7e2-1234-5678-abcd-ef0123456789). Run List DNS Zones to retrieve available zones; use the id field from each returned object — not the name field (e.g. example.com) or the type field. |
| `records` | `string` | Yes | JSON array of record objects that will REPLACE all records in the zone. Each object: { "name": "www.example.com", "type": "A", "content": "5.6.7.8", "ttl": 3600, "prio": 0, "disabled": false }. name, type, and content are required; name must be the fully-qualified domain name including the zone domain (e.g. www.example.com) - a short name like www is invalid. type must be one of the DNS record type constants (e.g. A, AAAA, CNAME, MX, TXT). Example: [{"name":"www.example.com","type":"A","content":"5.6.7.8","ttl":3600}]. |

## Run it

**MCP**

```ts
import { Client } from "@modelcontextprotocol/sdk/client/index.js"
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const accessToken = await pd.rawAccessToken

const transport = new StreamableHTTPClientTransport(
  new URL("https://remote.mcp.pipedream.net/v3"),
  {
    requestInit: {
      headers: {
        Authorization: `Bearer ${accessToken}`,
        "x-pd-project-id": process.env.PIPEDREAM_PROJECT_ID!,
        "x-pd-environment": "production",
        "x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
        "x-pd-app-slug": "ionos_hosting_services",
      },
    },
  },
)

const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)

const { tools } = await mcp.listTools()

// listTools() hands your model this tool's input schema, so it can
// fill the arguments itself:
const result = await mcp.callTool({
  name: "ionos_hosting_services-update-dns-zone",
  arguments: {
    zoneId: "Zone ID",
    records: "Records",
  },
})
```

**TypeScript**

```ts
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "ionos_hosting_services-update-dns-zone",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    ionos_hosting_services: { authProvisionId: "apn_xxxxxxx" },
    zoneId: "Zone ID",
    records: "Records",
  },
})

console.log(result)
```

**cURL**

```bash
curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
  -H "Content-Type: application/json" \
  -H "X-PD-Environment: production" \
  -H "Authorization: Bearer {access_token}" \
  -d '{
    "external_user_id": "{external_user_id}",
    "id": "ionos_hosting_services-update-dns-zone",
    "configured_props": {
      "ionos_hosting_services": { "authProvisionId": "apn_xxxxxxx" },
      "zoneId": "Zone ID",
      "records": "Records"
    }
  }'
```

---

- App: https://pipedream.com/apps/ionos-hosting-services.md · All apps: https://pipedream.com/apps
