API Queries - Update DNS
The update_dns API function updates the nameservers for a domain. You need to specify at least two nameservers and a maximum of four. Additional parameters are required for this function.
Additional Parameters
- domain - Domain name to updated. Note: http://www. should not be included.
- dns - New nameservers, seperated by commas (,). You need to specify at least two nameservers and a maximum of four.
Your API key is required and all values should be correctly URL encoded.
Example
In the below example, we will update the nameservers for "oranges.com" to "ns1.abovedomains.com" and "ns2.abovedomains.com" (domain=oranges.com&dns=ns1.abovedomains.com,ns2.abovedomains.com).
Query
Response
<results code="100" />
Example 2
There are various possible errors when updating nameservers for a domain. In this example, we will attempt to update nameservers for "oranges.com" to just "ns1.abovedomains.com" (domain=oranges.com&dns=ns1.abovedomains.com). As we have not specified at least two nameservers, the request will fail.
Query
Response
<results code="1303">
<msg>Invalid number of DNS servers specified</msg>
</results>
Error Codes
Possible error responses for this function are:
509 - Specified domain is not in your account
510 - Domain not specified or invalid domain
512 - Domain extension must be specified
514 - Domain is pending update or registrar/registry locked
1301 - Invalid DNS servers specified. Cannot update DNS
1303 - Invalid number of DNS servers specified
1304 - Please provide DNS servers
1305 - Use two different DNS servers
1306 - Update DNS not allowed on expired domain
1307 - Custom DNS function disabled
General errors, such as 401 - Invalid API key or 500 - System unavailable.
For a complete list of error responses, see the Error Codes manual page.