While trying to set DNS configurations for the new blog’s domain, I tried, at first, to use the bare domain. That means, using http://unstablebuild.com, instead of using any other subdomain, like http://www.unstablebuild.com.
A bare domain, also know as naked domain, zone apex, and root domain, can only be done through an
A record, while a subdomain requires only a
A stands for Address, and it maps a host to one or more IP addresses.
CNAME’s, on the other hand, specifies that the name in question is an alias of another domain, subdomain, or IP address.
As explained before, I am hosting this blog on S3, meaning that if I want to use the bare domain, I would need to create an
A record that points to AWS’ IP address. When you share an IP address with other sites, which is my case, the server has no idea what specific host you are trying to reach. In order to get the right result, the Host header must be used.
With that in mind, I tried a quick test: do a
GET request to one of the S3’s public IPs while using my bucket name as the host. Turns out it works:
Unfortunately, as explained on their forum, that’s not very reliable:
[…] S3 by its nature is subject to expansion and change as Amazon and its customers needs expand. S3 has multiple IP addresses in any case. So you cannot rely on the IP address, only the domain name.
For simplicity, I decided to change my mind and use
www. Consequently, all I needed to do was redirect the bare domain to the
www subdomain, and create a
CNAME record pointing to my S3 bucket endpoint. Plus, both services are already offered by my registrar.
After changing DNS configurations, I can now check that everything looks as expected:
As an alternative, there are free services, like wwwizer, that redirect requests from your naked domain to your
www subdomain. All you need to do is point through an
A record your bare domain to their IP address. You can see how that works without even changing your DNS configuration, by directly telnet to
- Services Version Lock with Docker and Jenkins
- Tips for your Distributed Project Inception or Meeting
- RFID, Dryers, and IoT
- Integration testing for nginx Routes
- Trunk Based Development with Multiple Services
- Problems with Branches per Environment
- Efficient Timer using a Circular Buffer
- Automatically Build and Deploy the Blog
- Useful UNIX Signals (SIGQUIT, SIGSTOP, SIGCONT)