DNS API Key
You will need to create a DNS API KEY for your account before you can use DNS API to manage your DNS remotely.
To create an API key, login to your account, click on “Settings” on the left menu and click “DNS API Key” to bring up the API Key
creation page. After the API Key has been created, you will need to use the key for every update of your DNS Records.
Bear in mind the parameter passed at Headers or http URL parameters will overwrite the value defined at JSON file.
Example JSON File to add SPF for the domain. SPF is the TXT record for the domain.
{
"domain":"example.com",
"add":{
"type":"TXT",
"name":"", //same as "name": "example.com"
"content":"v=spf1 mx include:dnsexit.com ~all",
"ttl":480, //ttl value is in minutes 480 = 6 hours
"overwrite":true //* optional, default false unless defined. True will overwrite existing settings
}
}
Example JSON File to add MX Record. MX defines the mail server that will receive Emails for the domain or mail zone
{
"domain": "example.com",
"add":{
"type": "MX",
"mail-zone":"", // "" is for Emails to @example.com. With value say "sub", will be for Emails for @sub.example.com
"mail-server": "mail.dnsexit.com",
"priority": 1, // the lower value has higher priority; therefore, the MX with lowest value will become the primary MX
"ttl": 480,
"overwrite": true // *filed optional. Default "false" unless defined. If true, it will just overwrite the existing definition
}
}
2. Add TXT for Domain SSL
Example JSON File setup TXT for Let's Encrypt SSL Verification for the example.com and www.example.com
{
"domain":"example.com",
"add":[
{
"type":"TXT",
"name":"_acme-challenge", //take the acme.sh name as example. Could be other name if you use other programs
"content":"ATZUQ6Inp0Dj6V5Qgv7ScT6rB8",
"ttl":0,
"overwrite":true
},
{
"type":"TXT",
"name":"_acme-challenge.www", //take the acme.sh name as example. Could be other name if you use other programs
"content":"_fFbVaP0gzAZsb9wOx__Kst9SWM",
"ttl":0,
"overwrite":true
}
]
}
1. Update the Domain's IP
Example JSON File to update the Domain's IPv4 address to 1.1.1.100
{
"domain":"example.com",
"update":{
"type":"A",
"name":"", //name can be "example.com" instead
"content":"1.1.1.100", //content is the new IPv4 address of the domain
"ttl":480 //ttl value is in minutes 480 = 6 hours
}
}
Add Multiple Records
Example to add A (Host), CNAME (Alias), and 2 MX Records
{
"domain":"example.com",
"add":[
{
"type":"A",
"name":"host1",
"content":"1.2.2.2"
},
{
"type":"CNAME",
"name":"mail",
"content":"mail.yahoo.com"
},
{
"type":"MX",
"mail-zone":"",
"mail-server":"mail1.dnsexit.com",
"priority":1,
"ttl":480,
"overwrite":true
},
{
"type":"MX",
"mail-zone":"",
"mail-server":"mail2.dnsexit.com",
"priority":2,
"ttl":480,
"overwrite":true
}
]
}
Update Multiple Records
{
"domain":"example.com",
"update":[
{
"type":"A",
"name":"host1",
"content":"1.2.2.2"
},
{
"type":"CNAME",
"name":"mail",
"content":"mail.yahoo.com"
},
{
"type":"MX",
"mail-zone":"",
"mail-server":"mail1.dnsexit.com",
"priority":1,
"ttl":480,
}
]
}
Mixed Add/Update/Delete
{
"domain":"example.com",
"add":[
{
"type":"A",
"name":"host1",
"content":"1.1.1.1"
},
{
"type":"CNAME",
"name":"mail2",
"content":"mail2.yahoo.com"
}
],
"update":[
{
"type":"A",
"name":"host2",
"content":"1.1.1.2"
},
{
"type":"CNAME",
"name":"mail",
"content":"mail.yahoo.com"
},
{
"type":"MX",
"mail-zone":"",
"mail-server":"mail1.example.com", //you can set it as "mail-server":"mail1" instead
"priority":1,
"ttl":480,
}
],
"delete":[
{
"type":"A",
"name":"host3"
},
{
"type":"TXT",
"name":"spf"
},
{
"type":"MX",
"mail-zone":"",
"mail-server":"mail3.dnsexit.com"
}
]
}