What is Time To Live (TTL)

Time to live (TTL) is used for computer data including DNS servers. It is nothing but time on the period of time or number of iterations or transmissions in computer and computer network technology that a unit of data (e.g. a packet) can experience before it should be discarded.

TTL and DNS Caching

TTL value tells local resolving name servers how long a record should be stored locally before a new copy of the record must be retrieved from DNS. The record storage is known as the DNS cache, and the act of storing records is called caching.

  1. TTL is part of the Domain Name System.
  2. TTLs are set by an authoritative nameserver for each resource record.
  3. TTLs are used for caching purpose. For example, www.dnsknowledge.com TTL value is 86400 seconds, which is 24 hours. The higher a record’s TTL, the longer the information will be cached, and the less queries a client will have to make in order to find the domain.
  4. TTLs will be used by the resolving name server to speed up name resolving by caching results locally.

Can I Set Shorter TTLs?

Yes, you can set shorter TTLs. However, it can cause heavier loads on an authoritative nameserver, but can be useful when changing the address of critical services like web servers or MX records (mail server pointers), and therefore are often lowered by the DNS administrator prior to a service being moved, in order to minimize disruptions.

Common TTL Values

Usually TTL value is 86400 seconds, which is 24 hours. This is good starting point for most records. However, you can set higher TTL for MX or CNAME records as they are expected to change very rarely. If your service is critical, it is recommend that you set TTL to 1 hour (3600 seconds).

How to terminate or delete a cPanel account through SSH

This post is updated because cPanel changed the script to remove an account via command line. This is simple to manage cPanel via server CLI (command line interface). Here we discuss about the command to terminate an account from CLI. In older versions of cPanel, the command was “killacct.” The original location for this script is:

/scripts/killacct
Or
/usr/local/cpanel/scripts/killacct

Syntax

/scripts/killacct username

Example

# /scripts/killacct crybit
Are you sure you want to remove the account "crybit" [y/N]? y
Running pre removal script (/usr/local/cpanel/scripts/prekillacct)......Done
Collecting Domain Name and IP......Done
......................
......................
......................
Updating ftp passwords for crybit
Purging ftp user crybit
Ftp password files updated.
Ftp vhost passwords synced
crybit account removed

Later cPanel changed the script from killacct to removeacct. In latest cPanel server, you can terminate an account using the following command:

/scripts/removeacct
Or
/usr/local/cpanel/scripts/removeacct

Syntax

/scripts/removeacct username

That’s it!
Please let me know if you have any questions regarding this.

Postgres Use the same encoding as in the template database, or use template0 as template.

Postgres

Use the same encoding as in the template database, or use template0 as template this is the

root@server:~# su postgres
postgres@server:~ $ psql -U postgres
psql (9.0.3)
Type "help" for help.
postgres=# update pg_database set datallowconn = TRUE where datname = 'template0';
UPDATE 1
postgres=# \c template0
You are now connected to database "template0".
template0=# update pg_database set datistemplate = FALSE where datname = 'template1';
UPDATE 1
template0=# drop database template1;
DROP DATABASE
template0=# create database template1 with template = template0 encoding = 'UTF8';
CREATE DATABASE
template0=# update pg_database set datistemplate = TRUE where datname = 'template1';
UPDATE 1
template0=# \c template1
You are now connected to database "template1".
template1=# update pg_database set datallowconn = FALSE where datname = 'template0';
UPDATE 1
template1=#
Ctrl+Z
postgres@server:~ $ exit
root@server:~#