Coder Social home page Coder Social logo

tnarik / chef-bind9-chroot Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fooforge/chef-cookbook_bind9

3.0 4.0 6.0 250 KB

Chef cookbook for BIND9

Home Page: http://community.opscode.com/cookbooks/bind9

License: Apache License 2.0

Ruby 75.58% HTML 24.42%

chef-bind9-chroot's Introduction

#Description

This cookbook takes care of the installation and configuration of BIND9. You're able to define some global variables and manage your zonefiles via data bags (json example below). It also supports automatic serial number generation and automatic resource records for chef nodes (see optional json in example below) No DNSSEC, no configurable logging, no rndc shell operations or other safety checks (named-checkconf, etc.).

If you want to help feel free to contribute (either here or at Mike Adolphs's cookbook, which this is based on)!

DISCLAIMER:
It works on my setup!

#Requirements

Platform:

  • Debian
  • Ubuntu
  • Centos

#Attributes

It's so much better if you take a look at the attributes/default.rb file for the full list, but this is a brief summary:

  • node[:bind9][:enable_ipv6] - Enables BIND to listen on an IPv6 address. Default is: On
  • node[:bind9][:allow_query] - Allow clients to query the nameserver. Default is: none
  • node[:bind9][:allow_recursion] - Allow recursive name resolution. Default is: none (to prevent DNS cache poisoning)
  • node[:bind9][:allow_update] - Allow dynamic DNS updates. Default is: none
  • node[:bind9][:allow_transfer] - Allow zone transfers globally. Default is: none
  • node[:bind9][:enable_forwarding] - Enables forwarding of requests. Default is: No forwarding
  • node[:bind9][:forwarders] - Array for forwarding DNS. Default is: 8.8.4.4 and 8.8.8.8 (Google DNS)
  • node[:bind9][:chroot_dir] - Enables running in a chroot'ed environment. Default is: no chroot'ing
  • node[:bind9][:disclose] - Enables disclosing CHAOS information. Default is: false

#Usage

Add "recipe[bind9-chroot]" to your run list. If you want to use BIND9 for serving domains you need add the appropriate data via data bags (example below). Please note that the data bag's structure is mandatory except:

  • TTL for DNS records (if you decide to leave it empty, the global TTL will take over).
  • IP for DNS records (if not available, node['ipaddress'] will be used).

In order to run a a chroot'ed Bind9 server, set the node[:bind9][:chroot_dir] to the desired chroot path and optionally the node[:bind9][:disclose] attributes.

To use this cookbook with Chef Solo, add "recipe[chef-solo-search]" to your run list, and create the data bags either manually or using the knife-solo_data_bag gem.

#Examples

To create and view the data bags:

$ knife data bag create zones
$ knife data bag create zones exampleDOTcom
$ ... do something ...
$ knife data bag from file zones exampleDOTcom.json

An example of a data bag with mail records and specific IPs.

{
  "id": "exampleDOTcom",
  "domain": "example.com",
  "type": "master",
  "allow_transfer": [ "8.8.4.4",
                      "8.8.8.8" ],
  "zone_info": {
    "global_ttl": 300,
    "soa": "ns.example.com.",
    "contact": "user.example.com.",
    "nameserver": [ "ns.example.com.",
                    "ns.example.net." ],
    "mail_exchange": [{
      "host": "ASPMX.L.GOOGLE.COM.",
      "priority": 10
    },{
      "host": "ALT1.ASPMX.L.GOOGLE.COM.",
      "priority": 20
    },{
      "host": "ALT2.ASPMX.L.GOOGLE.COM.",
      "priority": 20
    },{
      "host": "ASPMX2.GOOGLEMAIL.COM.",
      "priority": 30
    },{
      "host": "ASPMX3.GOOGLEMAIL.COM.",
      "priority": 30
    },{
      "host": "ASPMX4.GOOGLEMAIL.COM.",
      "priority": 30
    },{
      "host": "ASPMX5.GOOGLEMAIL.COM.",
      "priority": 30
    }],
    "records": [{
      "name": "www",
      "type": "A",
      "ip": "127.0.0.1"
    },{
      "name": "img",
      "ttl": 30,
      "type": "A",
      "ip": "127.0.0.1"
    },{
      "name": "mail",
      "type": "CNAME",
      "ip": "ghs.google.com."
    }]
  }
}

An example of a data bag with mail records and specific IPs.

{
  "id": "exampleDOTcom",
  "domain": "example.com",
  "type": "master",
  "allow_transfer": [],
  "zone_info": {
    "global_ttl": 300,
    "soa": "ns.example.com.",
    "contact": "user.example.com.",
    "nameserver": [ "ns.example.com.",
                    "ns.example.net." ],
    "mail_exchange": [],
    "records": [{
      "name": "www",
      "type": "A"
     },{
      "name": "img",
      "ttl": 30,
      "type": "A"
    },{
      "name": "mail",
      "type": "CNAME"
    }]
  }
}

#Contributions

This cookbook is derived from Mike Adolphs's, and specific contributions can be tracked via git.

chef-bind9-chroot's People

Contributors

fooforge avatar jcam avatar tnarik avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  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.