Giter VIP home page Giter VIP logo

pdns's Introduction

pdns Cookbook

Installs and configures PowerDNS (pdns). Sets up a recursor by default and can set up an Authoritative Server with multiple backends.

Requirements

Platforms:

  • Ubuntu (12.04, 14.04)

Required Cookbooks:

  • build-essential (for source build)
  • resolvconf (used in the server recipe for setting resolv.conf)

Suggested Cookbooks:

  • database (for configuring MySQL and Postgres users/databases)
  • mysql (for the MySQL backend)
  • postgres (for the PostgreSQL backend)

Attributes

Depending on the type of server you are installing there are specific options you may want to set via attributes. Each attribute file (other than default) corresponds to the type of PowerDNS server you are installing. This can be either a PowerDNS recursor, or an authoritative DNS name server. The default attributes apply to both types of installations.

default

Key Type Description Default
node['pdns']['user'] String User to setuid the pdns daemons pdns
node['pdns']['group'] String Group to setuid the pdns daemons pdns
node['pdns']['build_method'] String Type of installation, 'package' or 'source' package

authoritative

Key Type Description Default
['pdns']['authoritative']['config_dir'] String Path to the config directory /etc/powerdns
['pdns']['authoritative']['source']['url'] String URL to the PowerDNS Authoritative DNS Server Source Package https://downloads.powerdns.com/releases/pdns-3.4.1.tar.bz2
['pdns']['authoritative']['source']['path'] String The base path to setting up the source installation /opt
['pdns']['authoritative']['source']['backends'] Array List of backends to build and configure with PowerDNS ['gsqlite3']
['pdns']['authoritative']['package']['backends'] Array List of backends to install and configure with PowerDNS via packages ['gsqlite3']

authoritative server configuration

The ['pdns']['authoritative']['config'] array directly maps to each configuration directive in the configuration file. Of special note is any configuration option that needs a hyphen (-) should be defined as an underscore (_) and it will be converted at compilation time.

For example, if you want the version-string setting to be changed, you'll want to define it like so:

default['pdns']['authoritative']['config']['version_string'] = 'awesomedns'

Another thing to note is boolean values are mapped to 'yes' and 'no' respectively. If you want to remove a value, simply set it to 'nil' or do not define the attribute entirely.

authoritative server backends

Each backend has its own configuration parameters, which are omitted from the PowerDNS configuration by default. These parameters are stored in ['pdns']['authoritative'][< backend name>].

When the configuration file is rendered, values from the appropriate backend arroy are merged into the ['pdns']['authoritative']['config'] array.

When the gsqlite3 backend is used, this cookbook will set up the sqlite packages and database for you. If you wish to use gmysql or gpgsql backends, it's up to you to configure the database before including the pdns::authoritative recipe.

recursor

The ['pdns']['recursor']['config'] array directly maps to each configuration directive in the configuration file. Of special note is any configuration option that needs a hyphen (-) should be defined as an underscore (_) and it will be converted at compilation time.

For example, if you want the version-string setting to be changed, you'll want to define it like so:

default['pdns']['recursor']['config']['local_port'] = '53'

Another thing to note is boolean values are mapped to 'yes' and 'no' respectively. If you want to remove a value, simply set it to 'nil' or do not define the attribute entirely.

Recipes

authoritative

Sets up a PowerDNS Authoritative Server. Uses the gsqlite3 backend by default.

authoritative_source

Sets up a PowerDNS Authoritative Server from source. This is automatically selected based upon the node['pdns']['build_method'] attribute.

authoritative_package

Sets up a PowerDNS Authoritative Server from packages. This is automatically selected based upon the node['pdns']['build_method'] attribute. It is also the default install method.

recursor

Sets up a PowerDNS Recursor from packages.

Resources

pdns_domain

The pdns_domain resource creates a minimal domain definition in PowerDNS. This is made up of a domain entry, an SOA record, an NS record (required by the SOA), and an A record (required by the NS record).

Example:

pdns_domain "example.com" do
  soa_email '[email protected]'
  soa_ip '192.168.33.33'
end

Resulting domain (dig -t axfr example.com output):

example.com.            86400   IN      SOA     ns1.example.com. hostmaster.example.com. 1 10800 3600 604800 3600
example.com.            86400   IN      NS      ns1.example.com.
ns1.example.com.        120     IN      A       192.168.33.33
example.com.            86400   IN      SOA     ns1.example.com. hostmaster.example.com. 1 10800 3600 604800 3600

pdns_record

The pdns_record resource creates a DNS record in PowerDNS. All DNS records must be attached to an already-existing DNS domain.

Examples:

pdns_record 'example.com.' do
  type 'MX'
  domain 'example.com'
  content 'mail.example.com'
  prio 0
end
pdns_record 'mail.example.com.' do
  type 'A'
  domain 'example.com'
  content '10.0.101.11'
end

Usage

To set up a Recursor, simply put recipe[pdns::recursor] in the run list. Modify the attributes via a role or on the node directly as required for the local configuration. If using the recursor with an Authoritative Server running on the same system, the local address and port should be changed to a public IP and the forward zones recurse setting to point at the loopback for the local zone. This is generally assumed, and the default listen interface for the recursor is set to the nodes ipaddress attribute.

To set up an authoritative server, put recipe[pdns::authoritative] in the run list. To configure a backend other than SQLite, see the notes on backends above.

License & Authors

Copyright:: 2010-2014, Chef Software, Inc & 2014 Aetrion, LLC.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

pdns's People

Contributors

martinisoft avatar therobot avatar aeden avatar dje avatar http-418 avatar cwebberops avatar sethvargo avatar cbaenziger avatar nathenharvey avatar gitkeeps avatar stevendanna avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.