• Shell script to see Time-To-Live (TTL) for a DNS record on Linux, Unix, macOS and FreeBSD

    From nixCraft: Linux Tips, Hacks, Tutorials, And Ideas In Blog Format (RSS/FEED) ( Vivek Gite ) to All on Fri Jan 10 15:26:19 2025


    T
    TL is an acronym for Time-To-Live (TTL) in DNS. It sets the time in seconds that a DNS record is allowed to be cached by DNS resolvers (caching server) before it needs to be fetched again from the authoritative name server. In other words, longer TTL can reduce the load on authoritative DNS servers and improve response times by keeping records in the cache longer. The shorter TTL is useful for frequently changing DNS records, as it ensures that updates are propagated quickly across the Internet. Say you want to see the Time-To-Live (TTL) value for a given DNS record for A, AAAA, and MX. Here is a sample shell script that works on Linux, Unix, and macOS. You must have the
    bash and dig command installed
    .

    Love this? sudo share_on:

    Twitter

    -

    Facebook

    -

    LinkedIn

    -

    Whatsapp

    -

    Reddit

    The post
    Shell script to see Time-To-Live (TTL) for a DNS record on Linux, Unix, macOS and FreeBSD
    appeared first on
    nixCraft
    .