Skip to main content

ImportDnsRecords

Import DNS records for a domain using Cloudflare’s DNS-over-HTTPS API. This resource allows you to fetch DNS records for a domain and store them in a structured format that’s compatible with DNS management functions.

Properties

string
required
The domain to fetch DNS records for (e.g., “example.com”).
DnsRecordType[]
Specific record types to fetch. If not provided, defaults to all supported types.Supported types:
  • "A" - IPv4 address
  • "AAAA" - IPv6 address
  • "MX" - Mail exchange
  • "TXT" - Text record
  • "NS" - Nameserver
  • "CNAME" - Canonical name
  • "SOA" - Start of authority
  • "SRV" - Service record
  • "PTR" - Pointer record
Default: All supported types
number
Bump the resource to force a new import. Increment this value to re-fetch DNS records.

Returns

DnsApiRecord[]
The DNS records as a flat array. Each record contains:
  • name: Record name
  • type: Record type
  • TTL: Time to live
  • data: Raw record data
  • content: Record content (compatible with DNS management)
  • ttl: Normalized TTL value
  • priority: Priority for MX/SRV records (optional)
number
Timestamp when the records were imported.

Examples

Import all DNS records

Import specific record types

Import and transfer to Cloudflare

Force re-import with bump


DNS Record Types

The DNS utilities support the following record types:

A Record

Maps a domain name to an IPv4 address.

AAAA Record

Maps a domain name to an IPv6 address.

MX Record

Specifies mail servers for the domain.

CNAME Record

Creates an alias from one domain to another.

TXT Record

Stores text information, often used for verification and policies.

GoDaddy Utilities

Update nameservers for domains registered with GoDaddy.

updateNameservers

Update the nameservers for a GoDaddy domain.
Parameters:
  • domain: Domain name to update
  • apiKey: GoDaddy API key
  • apiSecret: GoDaddy API secret
  • nameservers: Array of nameserver hostnames