If you want to host a domain on a server at home, using your ISP’s connection, you will realize that your DNS provider (in my case GoDaddy) will not be in sync with the dynamic IP address assigned to you by your Internet provider. Let me show you a free and easy way of addressing this common issue.
One way of resolving the problem of keeping domain name in sync with dynamic IP address is to move domain name servers to a service such as DynDNS, TZO or No-IP, and then set up DNS records that will be updated by using one of their dynamic DNS clients. Unfortunately, all of these services are paid now, so let me outline a free option that will allow you to keep your domain name in sync with a dynamic IP address.
I recommend using a free dynamic DNS hosted on Amazon VPC called: DuckDns.org:
Just follow these 3 simple steps:
- Register a free account with DuckDNS. You’ll be assigned a free DuckDNS domain such as ServerAtHome.duckdns.org.
- Then install an update clients that will keep the above DuckDNS domain in sync with your dynamic IP address.
Note: I wrote two dynamic IP address update clients for DuckDNS myself:
- One is for Windows computers and I offer it as an open-source free solution, you can download it from here: DuckDNS Windows client.
- The second one is for Android devices, you can download it from Google Play: DuckDNS Android client.
- If your server is being hosted on Linux or other types of servers or devices, there are many other options, just check their website to download the client you need for your requirements: http://www.duckdns.org/install.jsp
- Once your domain is setup and being updated with your dynamic IP address, all you need to do on GoDaddy is to point your domain name’s CNAME record to that of ServerAtHome.duckdns.org and you’re done.
- Let’s illustrate this final step:
I will assume that your GoDaddy domain is called: ServerAtHome.com and DuckDNS domain that you’ve set up to update with Dynamic IP address is called: ServerAtHome.duckdns.org. All that needs to be done is to go to GoDaddy, navigate to settings of your ServerAtHome.com domain, and open the DNS Zone File tab.
Change the settings, so they look just like this:
Once you save the above settings, your domain www.ServerAtHome.com will always resolve to the most recent dynamic IP address of your home server and it’ll be kept in sync by update the client that is refreshing DuckDNS domain ServerAtHome.duckdns.org.
- Note: This will only work with CNAME such as www.ServerAtHome.com or other sub-domains of your base TLD. This will not work for the root domain: ServerAtHome.com. The reason for this is that the DNS specification does not allow CNAME records on the zone apex (the base domain). This is because MX records would break as the CNAME would be followed to its target first. More about this here: http://blog.dnsimple.com/2014/01/why-alias-record/. Anyhow, as long as you’re ok with your domain being accessible over www.ServerAtHome.com and not through ServerAtHome.com directly, this solution will work for you just fine.
GoDaddy naked root domain forwarding solution for the top-level domain
- If you want the root (base) domain being forwarded automatically to www.*, take a look at http://wwwizer.com. What they allow you to do is to point your root domain to 22.214.171.124 IP address and they will auto redirected the root domain traffic to the same domain with www in front. Which in our case will point to CNAME setup for a www record, or in other words to a DuckDNS.org domain. In the case of GoDaddy and our example above, all you need to do is to point A-record for ServerAtHome.com to 126.96.36.199 IP address. Note: this is a free service for all non-SSL traffic.
- Another way of achieving this goal is to forward all requests to your non-www address to www URL. This can be configured directly at GoDaddy by creating a 301 redirect for a root/”naked” domain. A simple guide for this process is outlined in this blog: How do I create a 301 redirect for a root/”naked” domain at GoDaddy
Easy, wasn’t it? :)