Filtering by Category: Uncategorized

Creating a Domain and DNS for an AWS EC2 Instance

Super easy! That's how I would describe creating a domain and setting up DNS for your Amazon Web Services EC2 server. I wanted to create a new domain for my app, and then create a subdomain-like name for my current server to function as a beta test server. For example, it means I had an existing EC2 server operating at, and I wanted to create a domain for, and I wanted my server at to function like a subdomain and respond to requests for or

This process assumes several things. For one, that you already have an EC2 instance running. Setting up a free tier EC2 is amazingly simple. For this, I performed the following for a free-tier EC2 server running a Node app. Secondly, this assumes that you want to route directly to your EC2 server, rather than, for say, some other AWS service. And last, this assumes usage of Amazon's Route 53 service for handling DNS.

This does not try to provide comprehensive detail, for that, see the excellent documentation for Amazon Route 53.

First, navigate to the Domains dashboard: from the AWS Console, under Networking, click on Route 53 to bring up the Route 53 dashboard. Then, on the left hand menu click on Registered Domains. Click the Register Domain button. Choose a domain name and complete the purchase process. This will initiate the process, and you will have to confirm via email. This process will register your domain and automatically set up the needed hosted zones. In this case, let's assume I've registered

Second, review your Route 53 hosted zones. After registering your domains, within a few minutes you will receive confirmation that your hosted zones are ready. Navigate back to the Route 53 dashboard and click on Hosted Zones. Click on the name of one your hosted zones (i.e. and you should see the hosted zone details with the list of 4 name servers. To see the records for that zone, click on the Go to Record Sets button.

At this point, you have an EC2 instance server and a domain, But what we want is to route to our EC2 instance.

Third, now create a record to route requests for to your server. From the list of record sets for your hosted zone, e.g. for, click on the Create Record Set button. This will bring up a box/form for creating a record. Enter a name for the record. You should see a Name box that provides a prefix to your hosted zone name, in this case, To create a record for simply leave the Name box empty. However, in this case, we want to route traffic to our server at So for Name, enter 'beta' and this will create a record name of For Type, select 'A - IPv4 address' to create an A record. For Alias click No (you can't alias an EC2 instance). Leave the default TTL time of 300. For Value, enter your public IP for your server. For Routing Policy leave the default dropdown selection of 'Simple'. Now click Create!

Now you should see the new record in the list. Do the same thing and create a record for the name It would be just as easy to create a record for and, but that's not what I wanted in this case. In just minutes, the created records will propagate and you should be able to ping or resolve in your web browser.


Hello world!

Coming soon! Posts about programming, web development, random tech observations, learnings and musing on tech, information service, management/leadership in IT, etc.

I'm looking forward to it! · Copyright © · Caveat Lector