About Liquid Web

A Leader In Managed Hosting since 1997

Our Heroic Support technicians are located on-site at each of our data centers.
Liquid Web Knowledge Base

Knowledge Base


How To: Lowering Your DNS TTLs
Filed under: Technical Support

Whenever making DNS changes, lowering your TTLs (Time To Live) 24 hours ahead of time will reduce the amount of time that your change takes to propagate.
This article assumes that you are running BIND on a linux server, that you already have an understanding of what DNS is, the different types of DNS entries, and how DNS works. Please note: The incorrect editing of your zone file can take your site offline. All editing must be done on the authoritative nameservers for the given domain.

Why and when to lower your TTL

Typically, DNS changes are quite infrequent. You will normally only make IP address changes when performing a migration of your domain, or moving your domain’s email to another server or service. If you are getting ready to change your domains IP address, you should lower your TTL 24 hours in advance, to allow the TTL change to fully propagate throughout the DNS infrastructure of the internet.

Where to change your TTL, and what to set it to

Below you see a typical zone file:

;Zone file for liquidweb.com
$TTL 14400
@      86400    IN      SOA     ns.liquidweb.com. admin.liquidweb.com. (
2009022402      ; serial, todays date+todays
86400           ; refresh, seconds
7200            ; retry, seconds
3600000         ; expire, seconds
86400 )         ; minimum, seconds
liquidweb.com. 86400 IN NS   ns.liquidweb.com.
liquidweb.com. 86400 IN NS   ns1.liquidweb.com.
liquidweb.com.  IN A   209.59.139.21
localhost  IN A   127.0.0.1
liquidweb.com.  IN MX 0   liquidweb.com.
mail  IN CNAME  liquidweb.com.
www  IN CNAME   liquidweb.com.
ftp  IN A   209.59.139.21
cpanel  IN A   209.59.139.21
webmail  IN A   209.59.139.21

The specific part we are concerned about here is the $TTL 14400. This portion is called your Zone File’s Time To Live, or TTL, and is set in seconds. This indicates to all clients and caching nameservers how often it should check back with the authoritative nameserver for updated information.

Note: Caching nameservers will store the answer they get, and the Serial Number for the zone file. Make sure when you make any changes to your zone file, you increment the serial number.

Leaving this setting at the default of 14400 (4 hours) is fine, but when you are preparing for any event that will require an IP change, you can limit your downtime by lowering that value, so the caching servers will check back more frequently. Typically 300 seconds (5 minutes) is good primary IP address changes.

To lower that value on the Linux Command Line

  1. Edit the zone file with your favorite command line editor.
  2. [benny@host /var/named/]
    : vi /var/named/example.com.db

  3. Change the value following the $TTL to the desired value.
  4. Update the Zone’s Serial number.
  5. Make BIND aware of your DNS changes by reloading the DNS zone.
  6. [benny@host /var/named/]
    : rndc reload example.com

  7. Test that your changes worked correctly using ‘dig’.
  8. [benny@host /var/named/]
    : dig @localhost example.com

Congratulations! Your TTLs have been lowered and you have taken the first step in preparing for your DNS change. Before making any other changes, or preparing to move your data, it is a good idea to make a backup of your site. Learn how.

===

Liquid Web’s Heroic Support is always available to assist customers with this or any other issue. If you need our assistance please contact us:
Toll Free 1.800.580.4985
International 517.322.0434
support@liquidweb.com
https://manage.liquidweb.com/

Be Sociable, Share!




    Copyright © 2011 Liquid Web, Inc. All Rights Reserved.