Export a DNS Zone

Similar to retrieving a DNS zone, you need to provide the UUID of the DNS zone that you want to export.

Prerequisite: You need an IONOS Cloud account with API credentials configured with the appropriate permissions.

To export an existing zone at IONOS Cloud DNS in a BIND format, follow this step:

  • Perform a GET request providing the zoneId of your zone.

Result: On a successful GET request, you receive the BIND file with the DNS zone having the UUID assigned.

Request

curl --location --request GET 'https://dns.de-fra.ionos.com/zones/d6ba6fc1-fc82-4f0c-b030-2638778e0bef/zonefile' \
--header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJraWQiO' \

Response

200 Successful operation

;Zone: example.com
;Exported: Sat Jul 22 10:30:18 UTC 2023
 
$ORIGIN example.com.
$TTL 3600
 
@   86400   IN  SOA example.com. hostmaster.1und1.com. (
                    2017060107  ; serial
                    28800   ; refresh
                    7200    ; retry
                    604800  ; expire
                    600 )   ; minimum
@   86400   IN  NS  ns-ic.ui-dns.com.
@   86400   IN  NS  ns-ic.ui-dns.de.
@   86400   IN  NS  ns-ic.ui-dns.org.
@   86400   IN  NS  ns-ic.ui-dns.biz.
www 60  IN  A   192.0.2.2
www 60  IN  AAAA    2001:0db8::1
shop    60  IN  CNAME   boutique.example.com.

Zone file

The exported zone file is in BIND format, a widely used format supported by most DNS software, including the BIND DNS server.

The file includes all record types associated with the selected zone, including SOA record, NS record, Service (SRV) record, and configuration information such as TTL values.

An example of a file in BIND format with an updated SRV record is as follows:

;Zone: example.com
;Exported: Mon Aug 14 09:20:53 UTC 2023

$ORIGIN  example.com.
$TTL 3600

@	86400	IN	SOA	example.com. hostmaster.1und1.com. (
					2017060107	; serial
					28800	; refresh
					7200	; retry
					604800	; expire
					600 )	; minimum
@   86400   IN  NS  ns-ic.ui-dns.com.
@   86400   IN  NS  ns-ic.ui-dns.de.
@   86400   IN  NS  ns-ic.ui-dns.org.
@   86400   IN  NS  ns-ic.ui-dns.biz.
www 60  IN  A   192.0.2.2
www 60  IN  AAAA    2001:0db8::1
shop    60  IN  CNAME   boutique.example.com.
sub12	60	IN	SRV	10 0 5223 server1.example.com.

Last updated