Redirecting a registered hostname to a dynamic DNS name

A user may already have a hostname registered with a name server that does not have Dynamic DNS capabilities. Most DNS services allow URL forwarding, however. That makes it possible to set up a free Dynamic DNS service (using the instructions above) with a free hostname (URL) and then forward the previously-registered static hostname (URL) to the Dynamic DNS hostname (URL).

For example, I set up a free Dynamic DNS hostname URL at DynDNS.com that is foobar.dyndns.org. I set up my software utility (DynDNS likes ddclient or inadyn) to constantly update the Dynamic DNS database for foobar.dyndns.org.

However, I have used example.myoriginalfoobar.com as a registered hostname (URL) for years, with a static DNS service (DinosaurDNS.org) that doesn’t have Dynamic DNS capabilities. I login to DinosaurDNS.org and set my DNS record for example.myoriginalfoobar.com to forward (using a CNAME (Alias) record) to foobar.dyndns.org.

Now anyone trying to access example.myoriginalfoobar.comwill be redirected to foobar.dyndns.org, which will then redirect them to whichever IP address my Dynamic DNS updating utility has specified.

Using forwarding rules, an infinite number of URLs can be forwarded to a single dynamic URL. (The primary host that resides at the destination IP address must then resolve the forwarded URLs (using virtual host or .htaccess files) and direct them to the appropriate server on the computer (or LAN).) For this reason, it is only necessary to have one dynamic DNS URL for your computer (or LAN).

CNAME aliases

Different DNS registrars have different methods of forwarding a URL, but in general there is one method common to all of them: CNAME aliases.

If you have a URL registered with a DNS registrar, go to the DNS settings for your domain name. Delete any A records (or other entries) and use only CNAME entries.

For example, let’s say my free Dynamic DNS URL is foobar.dyndns.org (at DynDNS.com). My domain URL is myoriginalfoobar.com, registered at DinosaurDNS Registrar.

Logging into DinosaurDNS Registrar, I edit the DNS settings for myoriginalfoobar.com (which in my control panel is found under Manage DNS). I make sure I have these entries:

Name Type Content @ CNAME foobar.dyndns.org. www CNAME foobar.dyndns.org. example CNAME foobar.dyndns.org.

The period (“full stop”) at the end of the URL is important to designate that the CNAME is a FQDN (fully qualified domain name). A CNAME should not have “http://” in it. The @ symbol indicates a URL name without the first segment, e.g. the URL myoriginalfoobar.com by itself. In this example, I am forwarding myoriginalfoobar.com, www.myoriginalfoobar.com, and example.myoriginalfoobar.com.

Using CNAME aliasing, the original URL is retained in the browser. It is up to you (using virtual host files or Rewrite rules in the .htaccess files of Apache, for example) if you wish to massage the URL at your server (to change it to a canonical name) or redirect it.