Tuesday, June 10, 2025

Multi-Value Routing Policies | Overview & Hands-On.

 Multi-Value Routing Policies - Overview & Hands-On.

  • Multi-Value Routing is a DNS-based routing policy used to return multiple healthy records (IP addresses or endpoints) in response to a DNS query. 
  • Multi-Value Routing is a simple way to implement basic load balancing and high availability without a separate load balancer.

 The concept of Multi-Value Routing

  • In Multi-Value Routing, the DNS server returns multiple values (e.g., A or AAAA records) when queried. 
  • Each of these values typically corresponds to a different instance of your application (in different Availability Zones, regions, or servers).
  • If health checks are configured, only healthy endpoints will be returned in the response.

 Use Case Example

Imagine a web app running on three EC2 instances behind no load balancer:

  • twtechapp-server-1 – IP: 192.0.2.1
  • twtechapp-server-2 – IP: 192.0.2.2
  • twtechapp-server-3 – IP: 192.0.2.3

NB:

  • When a client (user) resolves www.twtechapp.com  , the DNS returns all three IPs. 
  • The client (user) selects one, usually randomly or based on OS/network stack logic.

 Key Features

Feature

Description

Multiple Records

Returns multiple A/AAAA records.

Health Checks

Can associate Route 53 health checks with each record.

Built-in Load Sharing

Traffic gets distributed across multiple endpoints.

No Load Balancer Needed

Lightweight alternative to ELB/ALB for some scenarios.

 Pros

  • Simple & cost-effective: No load balancer required.
  • Improves availability: Fails over to healthy endpoints.
  • Easy to implement: Straightforward setup in DNS.
  • Works globally: All clients can receive multiple endpoints.

 Cons

  • Basic traffic distribution: No control over traffic percentage or geography.
  • Client-side logic: Depends on client/OS behavior to pick an IP.
  • Not true load balancing: It only offers rudimentary distribution.

 How twtech Configures Multi-Value Routing Policies in AWS Route 53: UI

  1. Create a Record Set for your domain (e.g., www.twtech.com).
  2. Select Routing Policy = Multi-value answer routing.
  3. Add multiple IPs or endpoint records.
  4. (Optional) Attach health checks to each value.
  5. Enable “Evaluate target health” if using alias records.

 DNS Response Behavior

  • Up to 8 healthy records are returned in response to a DNS query.
  • If no health checks are configured, Route 53 returns all records.
  • If all health checks fail, Route 53 still returns all records (to avoid full outage due to false negatives).

Sample DNS Response (A record)

Query to: api.twtech.com

# json 

{

  "Answers": [

    {"IP": "192.0.2.1"},

    {"IP": "192.0.2.2"},

    {"IP": "192.0.2.3"}

  ]

}

 When to Use Multi-Value Routing

twtech Uses it when:

  •  It wants simple DNS-based failover and basic load distribution.
  • Its is not using a load balancer but want to distribute traffic.
  • twteceh need a cost-efficient way to improve resilience.
  • twtech wants to improve DNS-level redundancy.

Project: Hands-on

  • How twtech creates and use the multi-value routing policy for it traffic to implement basic load balancing and high availability without a separate load balancer.

Step-1:

  • twtech Selects the hosted zone to create the record on: twtech.click

  • Create a record: multi-valuepolicy.twtech.click





Step-2:
  • twtech Verifies that the multi-value policy is working seamlessly from the url on the browser: multi-valuepolicy.twtech.click

Step-3:

  • From CloudShell:
  • twtech Installs bind-utils packages to run nslookup and dig  commands:  search and get more details about the a rocord.

sudo yum install bind-utils -y

  • Step-2
  • twtech lookup (search) the multi-valuepolicy record created: 
      nslookup multi-valuepolicy.twtech.click

Step-3
  • twtech digs (get more details)  into the multi-value policy record created: 

dig multi-valuepolicy.twtech.click

twtech-insights:

  • The dig and nslookup commands reveals that twtech application is reachable in all three regions deployed.
  • The three IP addresses in dig Answer section above indicate, that the application is running in three different Host (nodes or regions).

No comments:

Post a Comment

Amazon EventBridge | Overview.

Amazon EventBridge - Overview. Scope: Intro, Core Concepts, Key Benefits, Link to official documentation, Insights. Intro: Amazon EventBridg...