- Overview
- Module Description - What the module does and why it is useful
- Setup - The basics of getting started with dnscache
- Usage - Configuration options and additional functionality
- Reference - An under-the-hood peek at what the module is doing and how
- Limitations - OS compatibility, etc.
- Development - Guide for contributing to the module
The dnscache module installs, configures and manages the dnscache service.
The dnscache module handles installing, configuring and running dnscache on CentOS/Redhat, Fedora and Ubuntu.
- dnscache-run / ndjbdns package
- ndjbdns configuration file
- dnscache environment files
- dnscache service
Note: Ubuntu modifies /etc/resolv.conf to point to 127.0.0.1 which could pose a problem with DNS if dnscache is not started after the package is installed.
The Ubuntu version of dnscache also does not support multiple listen addresses and this module will fail if listen_ip has more than one value.
This module also does not perform any checks to ensure that the users and groups used in the provided parameters already exist.
include '::dnscache'
sets dnscache to listen on 127.0.0.1 and accept DNS
queries coming from 127.0.0.1. If you want to dnscache to accept DNS queries
from say a local network, then:
class { '::dnscache':
accept_net => [ '127.0.0.1', '192.168.1' ],
}
With CentOS/RedHat you need the epel repository
include '::epel'
Class['::epel'] -> Package['dnscache']
All interaction with the dnscache module can be done through the main dnscache
class. This means you can simply toggle the options in ::dnscache
to have
full functionality of the module.
- dnscache: Main class, includes all other classes.
- dnscache::install: Handles the packages.
- dnscache::config: Handles the ndjbdns configuration file and the dnscache environment variables
- dnscache::services: Handles the service.
The following parameters are available in the dnscache module:
An array listing of IP addresses or subnets that are written out to $dnscache_root/ip/ as separate files. The dnscache daemon accepts DNS requests from these IP/subnet addresses. Defaults to ['127.0.0.1']
CACHESIZE dnscache environment variable. Defaults to distribution default value.
Location of the dnscache.conf file used by ndjbdns. Defaults to /etc/ndjbdns/dnscache.conf
Group for the dnscache.conf file used by the ndjbdns package. Defaults to 0.
File permissions for /etc/ndjbdns/dnscache.conf. Defaults to 0644.
Owner of /etc/ndjbdns/dnscache.conf. Defaults to 0.
Location of the template that modifies /etc/ndjbdns/dnscache.conf. Defaults to dnscache/dnscache.conf.erb
File permissions for the ${dnscache_root}/log/run script that invokes multilog. Defaults to 0755.
Location of the template that modifies the original script in ${dnscache_root}/env/log/run Defaults to dnscache/dnscache-log-run.erb
File permissions for the ${dnscache_root}/log/run script that invokes dnscache Defaults to 0755
Location of the template that modifies the original script in ${dnscache_root}/env/run Defaults to dnscache/dnscache-run.erb
DATALIMIT dnscache environment variable. Defaults to distribution default value.
DEBUG_LEVEL dnscache environment variable. Defaults to 1
Account under which dnscache is invoked via ${dnscache_root/env/run . Defaults to Gdnscache.
ROOT dnscache environment variable. Defaults to /etc/sv/dnscache/root on osfamily Debian or /etc/ndjbdns on osfamily Redhat
Service directory for dnscache used by daemontools. Defaults to /etc/sv/dnscache.
Group for dnscache environment files placed in ${dnscache_root}/env when on
osfamily Debian and also
File permissions for dnscache environment files placed in ${dnscache_root}/env
when on osfamily Debian and also
Owner of dnscache environment files placed in ${dnscache_root}/env when on
osfamily Debian and also
FORWARDONLY dnscache environment variable. Defaults to undefined (nil).
gid that will be acquired by dnscache. Defaults to 2.
HIDETTL dnscache environment variable. Defaults to undefined (nil).
IPSEND dnscache environment variable. Defaults to 0.0.0.0
IP dnscache environment variable. Defaults to ['127.0.0.1']
Account that will be used to run multilog for dnscache. Must have a UID and GID. Defaults to Gdnslog.
Permissions for the /var/log/dnscache folder (osfamily: Debian) Defaults to 0755 .
MERGEQUERIES dnscache environment variable. Defaults to 1.
Sets the dnscache package to be installed. Can be set to 'present', 'latest', or a specific version. Defaults to present.
Determines the name of the package(s) to install. Defaults to 'dnscache-run' on osfamily Debian or 'ndjbdns' on osfamily Redhat.
Array of IPs that should contain the list of DNS root servers or if FORWARDONLY is used, the list of caching servers to query.
Determines if the service should be enabled at boot. Defaults to true.
Determines if the service should be running or not. Defaults to running.
Selects whether Puppet should manage the service. Defaults to true.
Selects the name of the dnscache service for Puppet to manage. Defaults to dnscache.
uid that will be acquired by dnscache. Defaults to 2.
This module has received limited testing against Puppet 3.8.7 and Puppet 4.x
This module has been tested on:
- CentOS 5/6
- Fedora 20
- Ubuntu 10.04/12.04/14.04
Patches are welcome.