How to get DNS zone files of my domains
Linode
Linode Staff
How to get DNS zone files of my domains
1 Reply
watrick
Linode Staff
The best way to retrieve DNS zone files is through the CLI and utilizing the Linode APIv4..
The following command will give a list of the domain IDs:
curl -sH "Authorization: Bearer $TOKEN" https://api.linode.com/v4/domains | jq | grep -i 'id\|domain' | grep 1 | awk -F':' '{print $2}' | tr ',' ' '
The following loop can be used to read in all the of domain IDs:
for i in ID1 ID2 IDN; do linode-cli domain records-view $i; done
The above portion can be modified to echo
the IDs to a .txt file or really whatever file you'd like.
I would also recommend taking a look at this Community Questions Site post regarding DNS zones: How to retrieve/save all DNS records?