EN
EspañolEnglishFrançaisDeutschPortuguêsItaliano
Sign in Start free
Route 53

How to create subdomains in Route 53 and make www and the bare domain lead to the same site

You want app.midominio.com pointing at another machine, or www.midominio.com and midominio.com opening the same website. How to create the records in Route 53, what a wildcard is, and why the www redirect is not done by DNS but by your server.

⏱ 15 minutes ◎ Basic level Updated on 26/10/2026

A domain is good for much more than one website. You can have app.midominio.com on one machine, intranet.midominio.com on another and clientes.midominio.com on an external service, without buying anything else: they are subdomains, and in Route 53 each one is a single line. And then there is the eternal question of www: making both ways of writing your domain lead to the same website. This guide solves both and clears up a common misunderstanding: DNS says where each name goes, but it does not redirect; the server does that.

Before you start: what each thing means

Domain and subdomain
midominio.com is the domain; anything in front of it separated by a dot (app.midominio.com) is a subdomain. They are created in DNS, not bought.
Route 53 and hosted zone
Amazon's DNS and your domain's "file" inside it, with all its records.
A record
A name points to an IP address. This is what you use for a machine of your own.
CNAME record
A name points to another name. Used for external services ("clientes.midominio.com goes to whatever.provider.com"). It cannot be placed at the root of the domain.
Alias record
A Route 53 invention that works like a CNAME but also at the root, for pointing to AWS services (CloudFront, load balancers, buckets).
Wildcard (*)
A *.midominio.com record answers for any subdomain that does not have its own record.
Redirect
When opening one address the browser ends up at another. It is done by the web server (or a service), not by DNS.
TTL
Seconds that others may remember the answer. Low while you are changing things, high once it is stable.

Step by step

  1. Open your domain's zone

    Route 53 console, Hosted zones, click your domain. You will see the records it already has: the root A record, perhaps the www one, the MX records for email. Each new subdomain will be one more record in this list.

  2. Create a subdomain pointing to a machine of yours

    Create record. Name: just the front part (app; Route 53 adds the domain). Type A. Value: the machine's static IP. TTL 300. Create. Within a few minutes app.midominio.com reaches that machine; the machine's web server has to know how to answer for that name (a "virtual host" or "server block"), otherwise it will show the default website.

  3. Create a subdomain pointing to an external service

    Your helpdesk, shop or newsletter provider tells you something like "create a CNAME from clientes to midominio.proveedor.com". So do exactly that: Create record, name clientes, type CNAME, value the name they gave you (without http:// and without a trailing slash). If the provider is an AWS service (CloudFront, a load balancer), use type A with the Alias toggle on and pick it from the dropdown.

  4. Decide what to do with www

    First, both names must reach your server: the root with an A record to the IP, and www with another A record to the same IP (or a CNAME to midominio.com). That is as far as DNS goes. Second, choose which one is the "official" name (nowadays usually without www) and have the other one redirect to it, so that Google does not see two identical websites and the padlock works on both.

  5. Do the redirect on the server

    This is not done in Route 53. On the machine, the web server has to answer www.midominio.com with a permanent redirect (code 301) to midominio.com. In Apache, in the site's block:

    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^www\.midominio\.com$ [NC]
    RewriteRule ^(.*)$ https://midominio.com/$1 [R=301,L]

    In Nginx it is a server block for www with a return 301. If you use the Bitnami blueprints on Lightsail, the bncert-tool asks exactly this when setting up the certificate and configures it for you. The HTTPS certificate must cover both names.

  6. Check and raise the TTL

    Open all four combinations (with and without www, with http and https): all of them must end up at https://midominio.com with the padlock. Open the new subdomain. Once everything has been stable for a few days, raise the TTL of the records to 3600 or more: fewer queries and faster answers.

What can go wrong

Route 53 will not let me create a CNAME at the root

It is a DNS rule. At the root use an A record with the IP, or an alias if the target is an AWS service. If the target is an external service that only gives you a name, ask them whether they have a fixed IP or put CloudFront in front.

The subdomain resolves but shows a different website

DNS has done its part; the server does not know that name is its own and shows the default site. Add the name to the virtual host (Apache) or server block (Nginx) of the right site.

I want a subdomain for each customer without creating records one by one

Create a wildcard record: name *, type A, the machine's IP. Any loquesea.midominio.com will reach it, and your application decides what to show based on the name. Specific records you create separately take priority over the wildcard.

I changed a record and nothing happens

TTL. Intermediate servers remember the old answer until it expires. Lower the TTL a few days before a planned change; if it is already done, all you can do is wait.

In Simplio

In Simplio each Route 53 domain is a card where the records read in plain language and creating a subdomain means choosing the name and the destination machine from a list: Simplio fills in the IP. Records for external services are added in one line with help according to the type, replacing an existing one asks for confirmation and removing one asks for two-factor. And the activity log keeps who changed what.

The same task, in AWS and in Simplio

In the AWS consoleIn Simplio
Creating a subdomainRoute 53, Create record, pick a type out of 12 options, TTLA line "app → this machine" on the domain card, with the IP already filled in
Knowing where each name pointsRead the table of technical recordsList in plain language: "the website goes to machine X, email is received by Y"
Breaking somethingAnyone with access can delete a recordRemoving a record asks for two-factor; NS and SOA are protected

Try it free for 15 days See how it works

All of this, without the AWS console

Simplio is a panel to manage your AWS accounts: machines, scheduled copies, databases, domains, email and what AWS charges you, with per-person permissions and two-factor. Nothing installed on your servers.

Start free for 15 days, no card

Already a customer? Customer access.