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
idstringrequiredzone_…).Body
nameserverstringrequiredsourceDomainstringExample
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.
{ "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 objectannotation.typestringA, AAAA, CNAME, ALIAS, MX, TXT, CAA, SRV, NS, TLSA.namestring@ is the zone root.valuestringttlnumberprioritynumberweightnumberportnumberisCloudflarebooleancloudflareWarningstringrecordSubtypestringSPF, DMARC, DKIM, DOMAINKEY, MS365.annotationstringnew, duplicate, conflict.conflictingValuestringannotation is conflict.parkingPagebooleandomainstring or nullnameserverstring or nullexistingCountintegerErrors
Errors are Problem Details with a stable code. Branch on the code, not on the text.
| 400 | The 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. |
| 401 | Unauthorized. Authentication is required. |
| 403 | Forbidden. The caller lacks a required scope or does not own the resource. |
| 404 | No DNS zone with this ID on the account. |
| 429 | Rate limited. Retry after the limit resets. 429 responses include Retry-After seconds plus X-RateLimit-* headers. |
| 500 | Internal error. Retry later or contact support if the issue persists. |