Reputation: 349
How to create domain and subdomain in AWS?
Upvotes: 34
Views: 38381
Reputation: 3154
Though this question is already answered and is years old, I just went through this process this week. I thought it be helpful to have screenshots of what I did to create a domain and subdomain in AWS.
To create Domain:
To create sub domain.
Upvotes: 2
Reputation: 71
Step 1 - For Domain a) Create a Hosted Zone. b) Update the NS and SOA records in domain name provider c) let the domain propagate.24-48hrs
Step 2 - For SubDomain a) Create CNAME record in the above hosted zone for example subdomain b) Point to the address for example website bucket https//bucket_in_S3
Your subdomain is ready and working with immediate effect.
Upvotes: 1
Reputation: 1701
I'm finding the other answers here a little cryptic. Here are the main steps for hosting your domain apex and any other host names for that domain in Route53. This is assuming that you've purchased a domain through GoDaddy, or Network Solutions, or wherever. (And as of mid-2014 you can buy domains directly in Route53):
If you run nodes in multiple AWS regions (not just across multiple AZ's) you can also use Route53's "latency based routing," which will direct users to the fastest node given latency at any given moment (it's based on lowest latency, not upon nearest geographic location). Or you can use Route53's healthchecks to set your record values -- e.g. if the healthcheck passes, your A record points to 1.2.3.4, if it fails, the A record points to 5.6.7.8.
EDIT: Another helpful Route53 trick I discovered (by happenstance, though I read later that it's a known/supported feature) is that you can use the A record aliasing to point to ELBs (or buckets, CloudFront distros, etc.) in other AWS accounts. They won't auto-populate in the dropdown list of aliases, but you can just copy+paste them into the "alias target" input.
Upvotes: 24
Reputation: 4378
AWS Route 53 can (as of 2016) allow you to register a domain via the https://console.aws.amazon.com/route53/home#DomainListing: page. I understand that it actually uses a third party to handle the registration, but you don't need to know that.
Once you have a domain, you can use Hosted Zones to connect to resources. I recall that the registration process above will automatically create a Hosted Zone for your domain name.
To link the domain to a resource, you need to go into that hosted zone and create an "A" Record Set. The interface is pretty self-explanatory.
If you want a subdomain, create another "A" record set in the same Hosted Zone: you have an option to set a prefix on the domain name each time, and of course to link to a different resource.
The https://docs.aws.amazon.com/AmazonS3/latest/dev/website-hosting-custom-domain-walkthrough.html tutorial is a bit heavy on jargon for the beginner, but covers the above points.
Upvotes: 1
Reputation: 4818
Using Amazon AWS Route 53 & Apache 2.4 web server
Create a Canonical name with wild card to route all the sub domains traffic to the root web server located.
Now add sub domains details along with root domain routings like below.
# -----------------------------------
# GS - Virtual Host Configurations
# -----------------------------------
<VirtualHost *:80>
ServerName www.gajen.com
ServerAlias gajen.com
DocumentRoot "/var/www/html"
</VirtualHost>
# Stagings
# --------
# Discovery
<VirtualHost *:80>
ServerName discovery.gajen.com
DocumentRoot "/var/www/html/discovery"
</VirtualHost>
# Alpha
<VirtualHost *:80>
ServerName alpha.gajen.com
DocumentRoot "/var/www/html/alpha"
</VirtualHost>
Upvotes: 44
Reputation: 319
After you create the domain settup in Route 53, just add the alias or CNAME like you do for www.yourdomain.com
here A-Record is yourdomain.com Cname is www.yourdomain.com
and so as your subdomain like
sub.yourdomain.com
the proccess is not hard just technical,
if you want more to learn on this , i will gladly do ,
AWS ROCKS
Upvotes: 0
Reputation: 99
You do not 'create' a domain or subdomain in AWS. A domain is created at the registrar level - GoDaddy, Network Solutions, VeriSign, etc. while a subdomain is created in DNS.
If you are referring to how you can create a web server to respond to mydomain.com and/or subdomain.mydomain.com then you will need to alter the mydomain.com DNS records to point to the IP address of your Amazon EC2 instance.
First, launch the EC2 AMI you intend to use as the web server. You will then need to allocate an Elastic IP address using the AWS console and assign it to the web server instance. Make a note of what the Elastic IP is. Now go to your registrar's domain control panel, and add/change the IP address of the A or CNAME records named 'www' and '@' to match the Elastic IP you assigned to the web server instance. Now create a new CNAME record for your subdomain and point it to '@'. Save your changes.
If your web server instance is running Apache, you will now have to configure Name Based Virtual Hosting - plenty of tutorials out on the web for this. If you are running IIS, you will have to assign host headers to your sites. Again, there are plenty of tutorials for that as well. Google is your friend.
Hope this helps.
Upvotes: 7
Reputation: 10854
Creating Domain name or subdomain name is not possible with AWS, You have to create it from the domain registrar and then point them to AWS Route 53 service - which maps you domain names to Ip's along with dedicated Name server for every hostzone.
Therefore the point is first create domain or subdomains from a third party domain registrar, and use AWS route 53 service for the rest Process.
Upvotes: -1
Reputation: 1220
It will be very important for you to design your solution with DNS in mind. Check out their Route 53 product. It's a programmable interface into DNS which also has a low time to propagate. This will be important if you need to make changes. You should be able to tell your registrar to point to Route 53.
I also highly recommend you put all of your servers behind the Elastic Load Balancer (ELB) server and point whatever DNS service you have to it. This will reduce any down time you might have when moving servers and upgrading.
Upvotes: 0
Reputation: 5327
You don't transfer your domain name to AWS. Rather allocate an Elastic IP address and the associate it to your instance. Then go to your domain provider and point your domain to the Elastic IP address. You don't need to transfer your domain to AWS. You can do this from the AWS management console.
In this way, you can start a second instance and test any application updates, then just move the Elastic IP to the second instance without having to make any changes with your domain provider
http://www.youtube.com/watch?v=c8yuGvnU3A0
Upvotes: 1