Route 53 - Records TTL (Time To Live) - Overview & Hands-On.
In Amazon Route 53, the TTL (Time To Live) is an important DNS record setting that specifies how long (in seconds) a DNS resolver or cache should store a record before discarding it and querying the authoritative DNS server again (like Route 53) for updated information.
Why TTL Matters important
- Caching Efficiency:
Higher TTL values reduce DNS lookups by caching the result longer,
improving performance and reducing load on your DNS servers.
- Flexibility and Updates: Lower TTL values make DNS changes (like failovers, IP
address changes) propagate faster.
TTL in Route 53 – Key Points
|
Attribute |
Description |
|
Defined per Record |
TTL is set individually for each
DNS record in Route 53. |
|
Value Type |
Integer, in seconds. Common
values: 300,
600, 3600, etc. |
|
Minimum TTL |
No enforced minimum, but very low
TTLs (e.g., <60s) may increase DNS traffic. |
|
Effect on Caching |
Shorter TTL = faster DNS
propagation, but higher load. |
|
Default Behavior |
twech must specify TTL when creating
records (some wizards suggest 300 seconds by default). |
Example
If twtech creates an A record
like:
# text
Name: www.web.twtechapp.com
Type: A
Value: 172.22.33.44
TTL: 300
That means any DNS resolver that
looks up www.example.com will cache the result for 5 minutes (300 seconds)
before re-querying Route 53.
twtech Best Practices
- Use low TTLs
(e.g., 60–300s) during:
- Website migrations
- IP changes
- Failover configuration
- Use high TTLs (e.g., 3600–86400s) for:
- Stable, rarely changing records
* Reducing DNS costs and latency
use case:
- To avoid querying the records too often.
- TTL is a value in seconds that indicates how long a DNS resolver (like twtech ISP) cache the DNS information before refreshing it from the authoritative nameserver.
- TTL can be
also be configured using the command-line tools: like
digornslookup.
Project: Hands-on
- How twtech creates a record set while setting value for : TTL
- Select the hosted zone to create the : A records
- Create the: A records
- Assign a name: springapp.twtechapp.com
- Value (PubIPv address of an instance): 18.220.xxx.154
- Set the TTL to: 120
seconds
- Create the A record for: springapp.twtechapp.com
Step-3:
- twtech uses the UI (browser) to access the A record
created:
NB:
- Sometime the browsers may not be compatible with the A
records: springapp.twtechapp.com
- Firefox : successfully queried the application
with the record set
- However, google chrome won’t query data from the application using the same A record: springapp.twtechapp.com
- twtech recommendation: if a browser is
not compactible, try another browser.
- twtech uses CloudShell to run nslookup for: A
records
Step-5:
- Install command bind-utilits utility:
- Step-5:
- twtech runs the nslookup command again to search for rocord set created: springapp.twtechapp.com
# Command: nslookup
springapp.twtechapp.com
Server: 127.0.0.11
Address: 127.0.0.11#53
Non-authoritative answer:
Name: springapp.twtechapp.com
Address: 18.220.xxx.154
Step-5:
twech uses the dig command to get more detail about the record set : dig springapp.twtechapp.com
Step-6:
- twtech edit the A record value (PubIPv4 address) to route traffic to an instance in another region:
- From Ohio to N. California.
- From:
To: save changes
NB:
- twtech makes sure the record set name already used in the account is not repeated
Step-7:
- twtech verifies that the A record edited and directed to the application N. California is reachable (accessisble from the public) : twetechweb.twtechapp.com
- Successfully,
traffic is now routed to the instance in us-west-1 (N.California) by simply: editing an existing A records.
NB:
- In order for twtech to query data from this instance, it
must take: 120 sec initially set for TTL, for new data to be queried from the
edited A record.
From:
- To: after 120 sec Time to live (TTL)
- Meaning, the records is cached for 120 secs
No comments:
Post a Comment