Intellipaat Back

Explore Courses Blog Tutorials Interview Questions

Explore Tech Questions and Answers

Welcome to Intellipaat Community. Get your technical queries answered by top developers!

0 votes
2 views
by (1.4k points)

I need to create a sub-domain in AWS. How can I achieve this?

1 Answer

0 votes
by (2.6k points)

You can redirect your subdomain to an EC2 instance or a load balancer for instance. For achieving this, refer to the below steps: 

1. If there is no hosted zone present already, create a hosted zone for your domain like (example.com).

2. A new hosted zone for your subdomain should be created, by clicking on "Create Hosted Zone". Domain names can be like (api.example.com) or whatever subdomain you need. Comments can be anything. Type should be a public host zone, as we need everybody to access via the internet. Click create.

3. Now, click on your hosted zone and select the ‘NS’ type recordset and copy the nameservers in the ‘value’ box, present in the right side. Go to the originally hosted zone ie., example.com and click on ‘create record set’.

4. Enter name with whatever subdomain hosted zones are called, Type as NS- Name server and in values, paste the copied nameservers. And click create.

5. Go back to the hosted zone of your subdomain and click on ‘create record set’.

6. If you need to redirect the subdomain, use an ‘A’ record. In the ‘name’ tab, enter the IP address or click yes and next to an alias, click ‘alias target’, select the AWS services. Then, click on ‘create’.

7. After 1 or 2 mins, enter your subdomain in the web browser. You can see the traffic is redirected to your domain.

For more information, check out this AWS Tutorial.

Related questions

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...