Skip to content

Preview DNS records from a nameserver

POST /api/v2/dns-zones/{id}/smartcopy-scan

Reads a domain’s records from another nameserver and compares them with this zone. Use it before you move DNS to Hostup to see what to copy. Nothing in the zone changes. sourceDomain defaults to the zone’s domain.

Each record has an annotation: new (not in the zone), duplicate (already in the zone) or conflict (the zone has another value, shown in conflictingValue). Names that only answer through the source’s wildcard come back as one * record set. parkingPage: true marks an address that only serves the old provider’s parking page. Import the records you want with POST /api/v2/dns-zones/{id}/smartcopy.

Errors on the input come back as 400 with a pointer to /nameserver or /sourceDomain and a code in errors[0].code. An API key limited to certain DNS records gets 403. It needs access to the whole zone.

Authentication: An API key with the scope write:dns. About keys and scopes

Request

Path parameters

idstringrequired
The DNS zone ID (zone_…).

Body

nameserverstringrequired
Public nameserver to ask, as a hostname or IP address.
sourceDomainstring
Domain to look up on that nameserver. Default: this zone’s domain.

Example

POST /api/v2/dns-zones/{id}/smartcopy-scan
curl -X POST "https://cloud.hostup.se/api/v2/dns-zones/zone_01hxa3b4c5d6e7f8g9h0j1k2m3/smartcopy-scan" \
-H "Authorization: Bearer $HOSTUP_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"nameserver": "ns1.example.net",
"sourceDomain": "example.com"
}'

Responses

200 The comparison.

Response 200
{
"records": [
{
"type": "A",
"name": "www",
"value": "192.0.2.10",
"ttl": 3600,
"annotation": "new"
},
{
"type": "MX",
"name": "@",
"value": "mail.example.com",
"priority": 10,
"annotation": "conflict",
"conflictingValue": "old-mail.example.com"
}
],
"domain": "example.com",
"nameserver": "ns1.example.net",
"existingCount": 8
}
Response fields
recordsarray of object
Records found on the nameserver, each with its annotation.
typestring
One of A, AAAA, CNAME, ALIAS, MX, TXT, CAA, SRV, NS, TLSA.
namestring
Record name relative to the destination zone. @ is the zone root.
valuestring
ttlnumber
prioritynumber
weightnumber
portnumber
isCloudflareboolean
True when the source record has proxy behavior that needs a check.
cloudflareWarningstring
A warning about the proxy behavior of the source record, to show when it applies.
recordSubtypestring
One of SPF, DMARC, DKIM, DOMAINKEY, MS365.
annotationstring
How the record compares with the destination zone. One of new, duplicate, conflict.
conflictingValuestring
The value in the destination zone when annotation is conflict.
parkingPageboolean
True when the address only serves the previous provider’s parking page. Such records are listed. Don’t preselect them for copying. Absent otherwise.
domainstring or null
The domain that was scanned.
nameserverstring or null
The nameserver that was asked.
existingCountinteger
Records in the zone when the comparison ran. At least 0.

Errors

Errors are Problem Details with a stable code. Branch on the code, not on the text.

400The input or the lookup failed. errors[0].code is missing_nameserver, invalid_nameserver, nameserver_not_public, nameserver_unreachable, dns_scan_failed or invalid_source_domain.
401Unauthorized. Authentication is required.
403Forbidden. The caller lacks a required scope or does not own the resource.
404No DNS zone with this ID on the account.
429Rate limited. Retry after the limit resets. 429 responses include Retry-After seconds plus X-RateLimit-* headers.
500Internal error. Retry later or contact support if the issue persists.