Associate a domain name with your home server behind a dynamic IP address

After succeeding at hosting your website on your beloved home server, you may want to use a domain name to access your website. But creating an A record won't work because you are behind a dynamic IP address...


tl;dr

  1. Create a sub-domain on no-ip.com that point to your server's IP
  2. Install their Dynamic DNS Update Client on your server
  3. Create a CNAME record that point your domain to your no-ip subdomain

Introducing : dynamic DNS

Services like no-ip.com will let you create a sub-domain (something like http://mywebsite.ddns.net) pointing to the IP address of your server. They propose a list of generic domain names that you can use to create your sub-domain on.

...and their basic plan is free.

add-no-ip

It also have a client you can download and install on your server. It will automatically detects when your server's IP changes and update DNS records accordingly. If set up correctly, your server will always be accessible using your sub-domain !

But I want to use my own domain name...

To do this, you gonna need to create a CNAME record on your domain name that points to your sub-domain on no-ip.com. Those records are meant (I believe) to point multiple sub-domains to the A record of your domain (ex: www.exemple.com and ftp.exemple.com pointing to exemple.com). But it apparently works if it points to a completely different domain.

add-cname

So in the end :

  1. Your domain name points to a free sub-domain
  2. This free sub-domain always points yo your server's IP address
  3. Therefore, your domain always point to your server

...while paying 0$ and writing 0 lines of code, hooray !