Tech Junkie Blog - Real World Tutorials, Happy Coding!: Iaas With AWS: Create An Application Load Balancer (Host)

Wednesday, October 13, 2021

Iaas With AWS: Create An Application Load Balancer (Host)

 In the previous post we went over how to create a Application Load Balancer, based on routes in the URL.  In this post we are going to change the rules so that it directs traffic based on host names.  For example we could have route to target group 1 and route to target group 2.  It's the same concept as the previous setup but instead of routes, we are using hostnames instead.

In order to implement this solution we need to setup a record in Route 53, which is AWS domain registration service.  You can follow along with the DNS names, but if you have a hostname registered with AWS that's even better.

1. So the first thing you want to do is go to Route 53 dashboard, go to Hosted Zones

2. Click on the hosted domain

3. Click on "Create Record" button, to create an A record

An A record is basically an alias record that points to the underlying IP address, for example an A record of points to some IP address.  If a browser sends a request to, it is directed to the server with a particular IP address.

4. Select "Simple Routing", then click "Next"

5.  Select "Define simple record"

6.  We want to create two A records, one is the root domain record and the other A record will be  First lets create the root record, leave the "Record name"  field blank so that the alias is just  Then route the traffic to the Application Load Balancer we created in the previous post. Then click on "Define simple record"

You should see the following if you are following along

7. Create another A record, but this time type accounts in the "Record name" field so the alias will be, then click on the "Define simple record" button. 

You should see the following A records, select both records and click on "Create records"

Now these records are created, which points to the load balancer.

8.  Now you want to add a rule to the load balancer to direct traffic to target group 2 if the hostname is  So go to the load balancer and click on the "View/edit rules"

9. Click on the + sign next to "Rules", click "+ Insert Rule", "+ Add condition", "Host header"

11.  The rule should look like the following, it basically says if the hostname is direct traffic to target group 2, else direct traffic to target group 1 if it's the root hostname. Click "Save"

12. Final rules should look like the following

Now if you type you should get a different instance from because they target different target groups.


  1. blogger templates Blogger Templates 2021 daily updates with newly designed free blogger templates. Blog templates with Highly SEO optimized, Responsive Layout professional blogger templates free latest Blogger template free download 2021 Free Blogger Templates. Are you looking for Free Blogger Templates for making a highly professional website

  2. Very interesting post. Thanks for sharing such a great post. Butterfly Lyrics

  3. Great article, This is really helpful for a newbie like me.
    custom logo design company

  4. This comment has been removed by the author.

  5. Great Amazing article you have here. I am glad I found it. I will bookmark you. By the way

    There are so many article rewriters but this is The best article rewriter tool


  6. Very nice and interesting article. Thanks for sharing information. Also check my website Best Poetry Wala


  7. Thanks for sharing this article. You have a lot of information about that and uh can also visit
    Massage center in Lahore for your wellness and mind relax spa.

  8. Mind blowing article you have good writing skill. Thanks for sharing this article And also visit Paint protection flim.
    ECM online shop


Search This Blog