This guide if for those that want a domain name for their private server/network but doesn’t have a static IP-address. No worries, this can be accomplished through a Dynamic Domain Name System (DDNS). There are many free suppliers av DDNS but they all work in a similar fashion, below is a guide for using FreeDNS.
Note, If you do have a static IP-address and a hosting provider:
The best thing is probably just to configure a CNAME DNS setting with your hosting provider and point a sub domain to your static IP-address. Example:
Domain | Type | Value |
---|---|---|
home.filegott.se | CNAME | 85.230.180.186 |
Depending on your hosting provider this can be done differently usually through a GUI.
Setup DDNS (using FreeDNS)
- Go to freedns.afraid.org and get a user account.
- Log in and create a DDNS by pressing “Dynamic DNS” and scroll down and press “[add]”:
Fill in the fields and press “Save!”. In this example i created the DDNS filegott.crabdance.com.
- Update DDNS with a new IP-address. There are many ways of doing this but maybe simplest is using:
http://[USERNAME]:[PASSWORD]@freedns.afraid.org/nic/update?hostname=filgott.crabdance.se&myip=85.230.180.123
Verify through FreeDNS webpage the IP-address got updated. - Setup automated update of IP-address. When doing this we don’t want to use the unencrypted HTTP url above but instead a safer HTTPS url, maybe through curl or Wget. There are example scripts ready to be downloaded from the page:
Scheduling can be done through Task Scheduler (Windows) or crontab (linux). I actually used my “router” as it already had support for FreeDNS.
Extra credit: CNAME a prettier domain name as DDNS (if you have a hosting provider)
My hosting provider doesn’t provide a DDNS service but they do enable users to create their own sub-domain and link them to other addresses:
Domain | Type | Value |
---|---|---|
home.filegott.se | CNAME | filegott.crabdance.com |
unifi.filegott.se | CNAME | filegott.crabdance.com |
So now by using the CNAME the browser will still display home.filegott.se but will be using the DDNS to get the correct IP. As you noticed I even added another domain that points to the same DDNS (IP-Address), why you ask? This is because I have NGINX reverse-proxy listening at filegott.crabdance.com that directs the request differently depending on the domain name used in request url.
To create a ddns on freedns.afraid.org will i have to pay?
No, it’s for free! They did sometimes send an email (every 3-6 month) wanting you to login to your account.
They haven’t done so for me for a very long time, maybe they have removed that requirement…