TimeToLive (TTL) (original) (raw)

Time-To-Live (TTL)

Last Updated : 13 Apr, 2026

Time-To-Live (TTL) defines how long data is considered valid in a network or system before it expires. It helps ensure that outdated information is automatically removed and refreshed when needed.

**Example: When you visit a website, its IP address is stored in your DNS cache with a TTL value. If you revisit the site before the TTL expires, the cached IP is used; otherwise, a new DNS lookup is performed to fetch updated information.

Working

TTL represents the hop limit, meaning how many routers a packet can pass through before being discarded.

ttl_1

Working of TTL

Example

Host A sends a ping packet to Host B with an initial TTL value of 225.

ttl_2

Example of TTL

TTL in DNS

TTL in DNS defines how long a DNS record is stored in cache before it is refreshed. It is a numerical value set in a DNS record on the domain's authoritative domain name server.

TTL in HTTP

Time-to-Live (TTL) in HTTP defines how long a resource can be cached before it must be refreshed.

TTL Configuration Guidelines

TTL Exceeded

TTL Exceeded occurs when an IP packet’s TTL value reaches 0 before it reaches its destination.

Application of TTL

The TTL value is used in the network utilities such as ping, traceroute, and pathping.

1. The ping command is used to test the reachability of the destination computer. It verifies whether the communication can take place between the source and destination computer or a networked device.

2. It works by sending ICMP Echo request messages to the target computer and then waiting for the response.

3. The execution of the ping command gives two important pieces of information: how many responses are returned and how long it takes for them to return.

ping command

ping command

4. The **tracert/traceroute command is used to trace the path between two devices.

5. There are multiple routers in the path using which connection is established. So, it will provide the names or IP Addresses of routers existing in the path of two connecting devices.

tracert command

tracert command

6. In Internet Protocol (IP) multicast, TTL may have control over the packet forwarding scope or range.

7. TTL is also employed in caching for Domain Name Systems (DNS). TTL is a numerical value that refers to the duration used herein by the DNS Cache server for serving a DNS record before contacting the authoritative server to get a new copy.

Time Limit or Hop Limit in TTL

Time-To-Live (TTL) defines the maximum number of hops a packet can travel in a network, and in IPv6 it is referred to as the Hop Limit.

Common TTL Values

TTL values define how long DNS records are cached before being refreshed, helping balance performance and update frequency.

Additional Uses of TTL