The DNS System powers the Internet as we know it today and is responsible for converting domain names into IP addresses and for placing them on the correct hosting server. But the DNS system would have been just a theoretical concept, if TTL was not presented.
TTL is an acronym for Time To Live and refers to the capability of the DNS servers to cache DNS records. It represents the amount of time that a DNS record for a certain host remains in the cache memory of a DNS server after the latter has located the host's matching IP address.
By specifying TTL settings for a particular domain's DNS records, webmasters define the frequency of website content updates. The longer the TTL value is, the faster the domain resolution time periods will be. The TTL value can be set from one to several hours, if you are not planning any changes to your domain's DNS records in the meantime. If you need to make such changes, you will have to decrease the TTL value entry to several minutes to avoid any outdated data on your website.
An example with ntchosting.com$TTL 86400
$TTL 1440mbr> $TTL 24h
DNS Zone file overview
The TTL value represents an essential part of the zone file of your domain name. In the basic format of any DNS zone file, the time to live (TTL) field actually comes first in line followed by several other records (Start of Authority - SOA, records). Now, if we pay a little more attention to the SOA section, they might turn out to be also quite easy to understand.
The SOA section begins with the zone's primary domain name (in this example we'll use ntchosting.com), after that it specifies the class of the zone, SOA, and then come the following seven specifications:
MNAME - This is the zone's master DNS server (for example ns1.ntchosting.com)
RNAME - This record specifies the email address of the person/authority that is in charge of managing the domain name, such as hostmaster.ntchosting.com (here @ is replaced by '.'). Serial number - Now this value has a special purpose. For optimal speed and efficiency, BIND (one of the most widely used DNS servers, designed for Unix-based operating systems) processes zone files into a different format. What happens is, when BIND loads a zone file at startup, it first looks up at its serial number and proceeds with processing the zone file only if its serial number is bigger than the last processed version. Thus, if you make modifications to a zone file, but leave unchanged its serial number, BIND will ignore your updated version. The typical format of a serial number comprises date and unique serial number (YYYYMMDDNN), such as: 2009010801 - for the second edition (01) of the file on January 8, 2009. This format allows 100 modifications to be made to the zone file per day.
Refresh - This value is configured to point the period at which the secondary or slave servers should poll the master server to check if the serial number of the zone file has been modified, and consequently - if the zone file needs to be updated.
Retry - A value, typically an hour or less, that specifies the timeframe within which the slave server should repeat the update request, if the master DNS server for the zone has failed to answer its latest query.
Expire - The 'Expire' value outlines the period of time for which the slave server will continue to use the existing data in case of a failure of the master DNS server. After the specified 'Expire' period is over, the data will be considered outdated and will be no longer used. The domain then will stop resolving. That's why this value should be set up long enough to allow for possible master server outages to be fixed.
Negative caching - TTL Negative responses (typically occurring when a requested record does not exist) can be also cached on non-authoritative servers. This field resembles a basic TTL, but especially sets the value for negative TTL responses. Small time periods are recommended (15min to 2h).
The SOA records can be listed in one line (or they may extend over one line) with spaces in between (view the example below).
To make the picture clearer, we would like to present to you the following example of a zone file, which lists the specifications of our domain ntchosting.com:
An example with the ntchosting.com zone file$TTL 1d
ntchosting.com has SOA record ns1.ntchosting.com. hostmaster.ntchosting.com. 1227715796 16384 2048 1048576 2560
Editing the DNS's TTL setting using the 'Custom DNS Records' tool
You can easily edit the TTL settings of the NS records of your domain names, using the 'Custom DNS Records' section in your Web Hosting Control Panel. Every record has its own TTL field which allows you to adjust its time-to-live settings. To edit the TTL for an existing record you need to input the new value in the TTL field and apply the changes by clicking on the 'Modify' button.
If you are adding a new record, you can specify its TTL value in the TTL field of the 'Add DNS record' form. To submit the new record click on the 'Add New' button.
TTL values are entered as seconds and the common TTL time value is 86400 seconds, which is virtually equal to one day (24 hours). With this value set for your domain, any changes to your DNS records will be reflected online in up to 24 hours.