Create my own nameserver for dynamic-DNS

May 10, 2013 17.3k views
Hi, I'm currently hosted on HeartInternet. While their cheapest-package servers are far more powerful than I require, I'm frustrated that I'd have to pay extra to get MySQL support (amongst other things). I also currently use dynamic DNS (via domains) to access my own computers. If I were to move to DigitalOcean (which I most likely will), then I'd have total control over my server's internal environment (hooray, databases!). Would I also be able to set up my own nameserver on the droplet, to enable a configuration similar to the following (specifically, the "dynamic" entries): => static: points to droplet, for LLMP or LAMP web server. => static: points to droplet, for ftps. => dynamic: my home IP address (NAT to handle things from there). => dynamic: my office IP address (as above). Basically, could I dump other dynamic DNS providers and have everything accessed via my domain name and my droplet? Are there any existing guides on how to do anything like this with droplets? Also, how easy would it be for me to migrate my email over? I don't use the inbox on HeartInternet, everything that goes into it is pulled into my Gmail account, so I wouldn't need to migrate any actual data from Heart's email system. I'd presumably just need to set up an IMAP or POP server for Gmail to pull mail from, and let Gmail's SMTP handle outgoing messages. Am I missing anything, or would it really be this simple to transfer my email over? Thanks, Mark
1 comment
9 Answers
If you use Digital Ocean's DNS server you can create an A record and keep it updated with this script I wrote: So you would install that on your home server and it would check its external IP address, compare it to the A record, via the DNS API, and update the A record if necessary.

We have a tutorial on how you can setup PowerDNS nameserver on your own droplet:

With PowerDNS you'll be able to manage your DNS records via control panel or by directly adding entries to the mysql database on your droplet.

by Bulat Khamitov
Here we'll walk you through the installation of PowerDNS on your CentOS 6.3 VPS.

So to create dynamic-DNS, could I host a script at, for example:

that updates the DNS database on the droplet, then have CRON jobs on my dynamic machines that periodically CURLs the script, to update the nameserver's IPs for dynamic subdomains?

After posting this, I'm going to read the link that you posted, so apologies if the link already describes a perfect solution to my question!


Thank you for that link, I should be able to figure out everything else regarding DNS from there!

Now onto email... I'll check the FAQ for how to do that before asking on here, since I'm probably not the first to do this!

Hi again,

I have PowerDNS set up and it works locally.
I've set the nameservers for my domain (at the registrar, HeartInternet) to "ns*" (*=1,2,3).
I've created A-records for my subdomains in the DigitalOcean control panel, and pointed them to my server.
Included is an A-record for "", which points to my server.
I also created an NS record that contains "".

While I wait for the updates to propagate through the DNS network, is there anything else that I need to do? Is there anything listed above that I shouldn't have done? This is my first play with DNS outside of a private network.

*works locally = works when tested locally (it is bound to
Having typed all that, I suddenly realise that creating subdomain A-records (excluding the "ns.mydomain") in the DigitalOcean panel is redundant! I'll remove them...
You have to create glue records at your registrar to point to your PowerDNS droplet.
Have another answer? Share your knowledge.