-
Notifications
You must be signed in to change notification settings - Fork 7
Linode DNS Manager API
dnsapi.ini record template:
# Linode API key
linode xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
domains.ini record template:
# Linode Domain ID
example2.com example2 linode xxxxxx
Linode has an HTTP-based API for many of their services, including the DNS Manager. Two bits of information are needed:
- An API key.
- The domain ID of the domain you need to add records to.
The API key's readily available through your profile in Linode's control panel, on the "API Keys" tab. I'd recommend creating a new key specifically for updating DKIM records, that way if you need to invalidate it you won't affect anything else. The process for creating a new key's straightforward, when it gives you the key value copy it onto the linode line in your dnsapi.ini file replacing the string of x's in the example dnsapi.ini file.
The domain ID's a bit harder to get. It's not available in the DNS Manager at all. What you have to do is fake an API call to the domains.list service, which returns a data structure listing data for all your domains including the domain names and IDs. Start by putting this into your browser's URL bar (do not hit Return at the end):
https://api.linode.com/?api_action=domain.list&api_responseFormat=human&api_key=
Then paste your API key onto the end and hit Return. You'll get back a page showing a graphical version of the data structure. Go through the innermost struct sections looking at the DOMAIN and DOMAINID entries, copying each DOMAINID value onto the end of the line for it's domain in your domains.ini file. If you look at the example domains.ini file, the Linode domain ID replaces the string of x's at the end of the line for the example2.com domain, after the word linode.