How to Transfer a Domain to AWS

November 22, 2017Leron AminComments Open

After you’ve installed an application such as WordPress on Amazon’s AWS, the next step is to transfer your domain name to AWS so that it links to your website.

Taking the time to properly configure a domain name for your website is an easy way to prevent search engine indexing issues from occurring.

By default, your public IP address will be used as the domain for your website. However, using a public IP address as your primary domain is bad for your website’s SEO.

If you would rather use a custom domain name such as yourwebsite.com, then read on for instructions on how to transfer your domain to AWS.

Before getting started with this tutorial, you should have already installed an application such as WordPress on an Amazon AWS EC2 virtual machine instance.

There are 7 steps in this tutorial:

  • 1. Copy Virtual Machine IP

  • 2. Create a Hosted Zone

  • 3. Add “A” Record

  • 4. Add “CNAME” Record

  • 5. Edit Domain Name Servers

  • 6. Test Settings

Optional Configuration:

  • Include WWW. Prefix

1. Copy Virtual Machine IP

transfer domain to aws
Login to your Amazon Web Services (AWS) account, and click on the Services link at the top of the page.
install wordpress on aws
Under the Compute column, click on the EC2 link.
install wordpress on aws
Next, click on the Instances link in the left-sidebar column.
install wordpress on aws
Use the bottom scrollbar to navigate right to copy your instance’s Public IP address.

2. Create a Hosted Zone

transfer domain to aws
In the URL bar of a new browser window, navigate to Route 53 by entering the following URL: https://console.aws.amazon.com/route53/home
transfer domain to aws
Click the Get started now button on the Route 53 homepage.
transfer domain to aws
Next, click the Create Hosted Zone button at the top of the page.
transfer domain to aws
On the Create Hosted Zone page, enter your domain name in the Domain Name field, then click the Create button to create a new hosted zone.

3. Add “A” Record

transfer domain to aws
At the top of the Hosted Zones page, click on the Create Record Set button.
transfer domain to aws
In the Type field, select A Record, and paste your public IP that you copied in one of the previous steps into the Value field, then click the Create button at the bottom of the page.

4. Add “CNAME” Record

transfer domain to aws
Next, click the Create Record Set button at the top of the page to create another Record.
transfer domain to aws
Enter www in the Name field, and select CNAME as the record type. In the Value field, enter your domain, then click on the Create button.

5. Edit Domain Name Servers

transfer domain to aws
On your Hosted Zones homepage, copy the nameservers in NS section of the page.
transfer domain to aws
Head over to your Domain Name registrar (Name Cheap is used in this example) and assign the nameservers that you just copied to your domain.

6. Test Settings

transfer domain to aws
After a few minutes, try accessing your site by entering your domain name into the URL bar. If everything is configured properly, you will see your WordPress homepage.

Optional Configuration

How to Include WWW. Prefix

By default, your domain will show without the www. prefix.

If you would rather your domain show up as www.example.com instead of just example.com, then read on for configuration instructions.

NOTE: The instructions below are intended for users running Bitnami’s WordPress stack on AWS. If you’re using a different Apache configuration, remember to substitute the bitnami.conf file with your server’s htaccess equivalent.

In order to add the www. prefix to your domain, you will first need to configure an SSH client to connect to your EC2 instance. To learn how to SSH into your EC2 instance, check out How to SSH into EC2 Instance (AWS).

transfer domain to aws configure www
After you SSH into your EC2 instance by following the instructions in this tutorial, copy and paste the command below to open your server’s configuration file (right-click to paste).
sudo nano /opt/bitnami/apache2/conf/bitnami/bitnami.conf
transfer domain to aws configure www
Now that you’ve opened your server’s configuration file, copy and paste the three lines of code below in the exact same location as shown in the image. Save changes to the file (CTRL + O) then exit (CTRL + X) to the home screen.

RewriteEngine On

RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
transfer domain to aws configure www
Now that you’ve opened your server’s configuration file, copy and paste the three lines of code below in the exact same location as shown in the image. Save changes to the file (CTRL + O) then exit (CTRL + X) to the home screen.
sudo /opt/bitnami/ctlscript.sh restart apache

Did it work?

If you have general questions or comments about this tutorial, please feel free to leave them below.

If you benefited from this tutorial, and would like to support One Page Zen, please like our Facebook page and subscribe to our YouTube channel.

Thanks,

signature

transfer domain to azure
Transfer a Domain Name to AWS

Leave a Reply

Your email address will not be published. Required fields are marked *

Made with by

© 2020 One Page Zen Systems, LLC  
Legal  |  Privacy Policy  |  Affiliate Disclosure  |  Contact  

Join our Mailing List!

Exclusive early access to the latest tutorials

Monthly update with a list of upcoming tutorials

Special access to members-only events and webinars