Question

Create my own nameserver for dynamic-DNS

  • Posted May 10, 2013

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 dyn.org/afraid.org 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):

www.mydomain.co.uk => static: points to droplet, for LLMP or LAMP web server. ftps.mydomain.co.uk => static: points to droplet, for ftps. home.d.mydomain.co.uk => dynamic: my home IP address (NAT to handle things from there). work.d.mydomain.co.uk => 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 @mydomain.co.uk email over?

Thanks, Mark

Subscribe
Share

This is really old, but I’m going to answer it for future reference. Yes, you can use BIND9’s DNSSEC updater to build one. You can either forward emails with postfix or setup postfix and imap/pop (Dovecot is good) to host them on the VPS.

Don’t forget to add swap if you have a small VPS, so that services won’t crash. https://www.digitalocean.com/community/tutorials/how-to-configure-virtual-memory-swap-file-on-a-vps

I’ve published my solution on github at https://github.com/jenkstom/python-ddns


Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

If you use Digital Ocean’s DNS server you can create an A record and keep it updated with this script I wrote:

https://github.com/chandwer/DigitalOcean-DDNS

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.

For more info, check out: <a href=“https://www.digitalocean.com/community/articles/how-to-create-vanity-or-branded-nameservers-with-digitalocean-cloud-servers”>How to Create Vanity or Branded Nameservers with DigitalOcean Cloud Servers</a>

You have to create glue records at your registrar to point to your PowerDNS droplet.

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…

*works locally = works when tested locally (it is bound to 0.0.0.0)

Hi again, <br> <br>I have PowerDNS set up and it works locally. <br>I’ve set the nameservers for my domain (at the registrar, HeartInternet) to “ns*.digitalocean.com” (*=1,2,3). <br>I’ve created A-records for my subdomains in the DigitalOcean control panel, and pointed them to my server. <br>Included is an A-record for “ns1.mydomain.co.uk”, which points to my server. <br>I also created an NS record that contains “ns1.mydomain.co.uk”. <br> <br>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. <br> <br>Thanks, <br> Mark

Bulat, <br> <br>Thank you for that link, I should be able to figure out everything else regarding DNS from there! <br> <br>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! <br> <br>-Mark

Hi, <br> <br>So to create dynamic-DNS, could I host a script at, for example: <br> <br>http://dns.mydomain.co.uk/renew.php?subdomain=<name>&ip=<address>&hash=<crypto-authentication> <br> <br>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? <br> <br>=== <br>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! <br>=== <br> <br>Thanks, <br> Mark <br>

Hi, <br> <br>We have a tutorial on how you can setup PowerDNS nameserver on your own droplet: <br> <br>https://www.digitalocean.com/community/articles/how-to-install-powerdns-on-centos-6-3-x64 <br> <br>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. <br> <br>Thanks, <br>Bulat.