pgsqlcache is a caching DNS server based on the dnscache framework, reading and storing data to PostgreSQL table.
Normally pgsqldns would be set up by the pgsqldns-conf program, but that program doesn't exist yet.
pgsqlcache connects to a PostgreSQL server as specified by $PGHOST, $PGPORT, $PGUSERNAME, $PGPASSWORD, and $PGDATABASE. After connecting, it executes any commands found in $SQL_INITIALIZE.
DNS records stored in database must have ttl at least $DB_INSERT_TTL. Records in database are refreshed if ttl of new record is at least $DB_REINSERT_TTL bigger than current ttl of old record. New records are commited in $COMMIT_GROUP groups. Every $DB_MAINTENANCE minutes, regular database maintenance is done and every $STATS_INTERVAL query statistics are printed. Regular maintenance removes Duplicate and expired records. If $DB_KEEP_EXPIRED is set to nonzero, expired records are not cleaned from database, but there are not served to clients unless $DB_LOAD_EXPIRED is set to nonzero.
See the dnscache documentation for full configuration details.