---
title: "Clone another domain's DNS onto this one"
method: POST
path: "/api/domains/{domain}/dns/clone"
tags: ["DNS"]
---

# Clone another domain's DNS onto this one

`POST /api/domains/{domain}/dns/clone`

## Request

- Base URL: `https://domani.run`
- URL: `https://domani.run/api/domains/{domain}/dns/clone`
- Auth: HTTP bearer

Copies the DNS setup of a source domain you own onto this domain - useful for multi-TLD brands (brand.com → brand.dev) that share the same A/CNAME/MX. Merges by default (source records win on any type+name collision, this domain's other records are kept); set `replace: true` for an exact mirror.

Mail routing: a change to where the domain's mail is delivered (its MX or NS records, the address records an MX host inside the zone resolves through, or those of a host that receives Domani mail and publishes no MX) needs the `email:auth_secrets` scope, since whoever receives the mail receives its sign-in codes. Without it the request answers 403 INSUFFICIENT_SCOPE before anything changes, and a token confined to mailboxes answers 403 MAILBOX_CONFINED even with it. Other records need only `domains:write`. Every routing change is recorded in the audit log.

## Path parameters

- `domain` string, required

## Request body

- object
  - `from` string, required: Source domain to copy DNS from (must be yours)
  - `replace` boolean: Exact mirror - drop target records the source doesn't have. Default: merge

## Response `200`

DNS cloned

- object
  - `success` boolean
  - `from_domain` string
  - `to_domain` string
  - `records` DnsRecord[]
    - `type` 'A' | 'AAAA' | 'CNAME' | 'MX' | 'TXT' | 'NS' | 'SRV' | 'CAA' | 'TLSA', required: DNS record type. TLSA publishes a DANE record; its value is the rdata 'usage selector matching-type hex-data'.
    - `name` string, required: Record name (@ for root, or subdomain, e.g. _443._tcp for TLSA)
    - `value` string, required: Record value (IP address, hostname, or TLSA rdata like '3 1 1 abc123...')
    - `ttl` integer, required: Time to live in seconds
    - `priority` integer: Priority value (required for MX records)
    - `required` boolean: False when the zone Domani manages for the domain cannot hold the record (a TXT longer than the registrar accepts); such a record is shown but not needed for mail to work. Absent on plain zone records.

## Other responses

- `400`: Invalid request parameters
- `401`: Missing or invalid API key
- `403`: Moving the domain's mail needs the email:auth_secrets scope (INSUFFICIENT_SCOPE) and a token not confined to mailboxes (MAILBOX_CONFINED)
- `404`: Domain not found
- `429`: Rate limit exceeded - wait and retry

---

[API](https://skmtc.dev/domani/apis/domani-run-api.md) · [All operations](https://skmtc.dev/domani/apis/domani-run-api/llms.txt) · [OpenAPI document](https://skmtc.dev/domani/apis/domani-run-api/revisions/7679f8159533?raw)
