pgsqldnscache is a caching DNS server based on the dnscache framework, reading and storing data to PostgreSQL table. Data are cached in memory, so there is no performance overhead caused by SQL backend. This program can be used as persistent cache for dialups or in environmnents where you need to modify dns cached data.
Normally pgsqldnscache would be set up by the pgsqldnscache-conf program, but that program doesn't exist yet. You can use pgsqldns-conf and edit results by hand.
pgsqldnscache connects to a PostgreSQL server as specified by $PGHOST, $PGPORT, $PGUSERNAME, $PGPASSWORD, and $PGDATABASE. After connecting, it executes any commands found in $SQL_INITIALIZE. This program expects to find table dnscache with read/write access in the configured database, run create.sql for creating it.
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.