DNS functionality added to the API | Heart Internet Blog – Focusing on all aspects of the web

In response to demand from our reseller hosting customers, we’ve added DNS functionality to the API. This allows you to find out exactly what DNS records we’ll serve for a domain name, and allows you to make arbitrary changes to them. We hope that this will make it easy for you to automatically set up custom DNS (e.g. set up SRV records for third-party services, or SPF records for email), and this will allow you to create your own DNS management interface if you want to.

Not currently using our API?

All our reseller hosting customers have free access to our API, and you can find out more information here (including your log-in details): https://customer.heartinternet.uk/manage/api

How to use this new functionality

Using this functionality is really easy. Once you’ve loaded the ext-dns object, you can issue an extended domain info request:

 

<?xml version=”1.0″?>

 

 

 

 

 

example.org

 

 

 

xmlns:ext-dns=”https://www.heartinternet.uk/whapi/ext-dns-1.0″/>

 

 

bc2cf3a9d78940cd811831a4f2effd93

 

 

The response will then return, in addition to the usual information, every DNS record we have stored for the domain:

 

<?xml version=’1.0′?>

 

 

 

 

Command completed successfully

 

 

 

 

xmlns:ext-dns=”https://www.heartinternet.uk/whapi/ext-dns-1.0″>

 

127.0.0.1

 

127.0.0.4

 

127.0.0.6

 

::1

node=”groupware”>

groupware.some-offsite-provider.example.org.

 

mail

 

mail

 

ns1.mainnameserver.com.

 

ns2.mainnameserver.com.

weight=”5″>

mail:25

weight=”5″>

groupware:143

 

Some text here

 

 

 

 

bc2cf3a9d78940cd811831a4f2effd93

 

test-109471ac1fc3ece827a290f7b0f8ebb1

 

 

 

If you want to add or delete records, you just send something very similar to the above (in

and

blocks) as part of a domain update command:

<?xml version=”1.0″?>

 

 

 

 

 

example.org

 

 

 

xmlns:ext-dns=”https://www.heartinternet.uk/whapi/ext-dns-1.0″>

 

weight=”5″>

mail.somewhere-else.example.org.:25

weight=”70″>

backupmx1.somewhere-else.example.org.:25

weight=”30″>

backupmx2.somewhere-else.example.org.:25

 

 

weight=”5″>

mail:25

 

 

 

 

8074d3abb4bbe1c86af43ea1316a090d

 

 

Updates will be performed exactly as if you’d been updating the DNS records from the domain control panel.

 

Comments

Please remember that all comments are moderated and any links you paste in your comment will remain as plain text. If your comment looks like spam it will be deleted. We're looking forward to answering your questions and hearing your comments and opinions!

Got a question? Explore our Support Database. Start a live chat*.
Or log in to raise a ticket for support.
*Please note: you will need to accept cookies to see and use our live chat service