Puppet Class: allknowingdns

Defined in:
manifests/init.pp

Summary

Install and configure allknowingdns using puppet.

Overview

Examples:

class { 'allknowingdns':
  listen  => ['2001:db8:42::1', '203.0.113.1'],
  network => '2001:db8:1337::/48',
  address => 'example.com',
}
class { 'allknowingdns':
  listen     => ['2001:db8:42::1', '203.0.113.1'],
  network    => '2001:db8:1337::/48',
  address    => 'example.com',
  exceptions => {
    '2001:db8:1337::1' => 'a.example.com',
    '2001:db8:1337::2' => 'b.example.com'
  }
}

Parameters:

  • listen (Array[Stdlib::IP::Address]) (defaults to: ['::1','127.0.0.1'])

    Listens on the given address (IPv4 and IPv6 is supported) on port 53.

  • network (String[1]) (defaults to: 'UNSET')

    Specifies that queries for PTR records within the given network should be answered (any query for an unconfigured network will be answered with NXDOMAIN). You need to specify at least the resolves to directive afterwards.

  • address (String[1]) (defaults to: 'UNSET')

    Specifies the address to which PTR records should resolve. When answering AAAA queries, %DIGITS% will be parsed and converted back to an IPv6 address.

  • address_prefix (String[1]) (defaults to: 'ipv6-')

    Specifies the address prefix (before %DIGITS%) to which PTR records should resolve.

  • exceptions (Hash) (defaults to: {})

    Specifies exceptions (specific addresses for IPv6 /128)

  • upstream (String[1]) (defaults to: 'UNSET')

    Before answering a PTR query for this network, AllKnowingDNS will ask the DNS server at address first, appending .upstream to the query.

  • package_name (String[1]) (defaults to: 'all-knowing-dns')

    All-knowing-dns package name (depends on distribution)



25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# File 'manifests/init.pp', line 25

class allknowingdns (
  Array[Stdlib::IP::Address] $listen = ['::1','127.0.0.1'],
  String[1] $network                 = 'UNSET',
  String[1] $address                 = 'UNSET',
  String[1] $address_prefix          = 'ipv6-',
  Hash $exceptions                   = {},
  String[1] $upstream                = 'UNSET',
  String[1] $package_name            = 'all-knowing-dns',
) {
  if ! is_domain_name($address) {
    fail("${address} is not a valid domaine name")
  }

  package { $package_name:
    ensure => installed;
  }

  file { "/etc/${package_name}.conf":
    ensure  => file,
    owner   => 'root',
    group   => 'root',
    mode    => '0644',
    content => template("allknowingdns/${package_name}.conf.erb"),
    notify  => Service[$package_name],
    require => Package[$package_name],
  }

  service { $package_name:
    ensure     => running,
    enable     => true,
    hasstatus  => true,
    hasrestart => true,
    require    => Package[$package_name];
  }
}