[511] | 1 | # |
---|
[513] | 2 | # dnsmasq configuration |
---|
[511] | 3 | # |
---|
[513] | 4 | |
---|
| 5 | <% if dhcp_range != 'absent' -%> |
---|
| 6 | # This to enable the integrated DHCP server, you need |
---|
| 7 | # to supply the range of addresses available for lease and optionally |
---|
| 8 | # a lease time. If you have more than one network, you will need to |
---|
| 9 | # repeat this for each network on which you want to supply DHCP |
---|
| 10 | # service. |
---|
| 11 | dhcp-range=<%= dhcp_range %> |
---|
| 12 | <% end -%> |
---|
| 13 | |
---|
[536] | 14 | <% if dhcp_authoritative != 'absent' -%> |
---|
[513] | 15 | # Set the DHCP server to authoritative mode. In this mode it will barge in |
---|
| 16 | # and take over the lease for any client which broadcasts on the network, |
---|
| 17 | # whether it has a record of the lease or not. This avoids long timeouts |
---|
| 18 | # when a machine wakes up on a new network. |
---|
[511] | 19 | dhcp-authoritative |
---|
| 20 | <% end -%> |
---|
| 21 | |
---|
[513] | 22 | <% if dhcp_gw != 'absent' -%> |
---|
| 23 | # Override the default route supplied by dnsmasq, which assumes the |
---|
| 24 | # router is the same machine as the one running dnsmasq. |
---|
| 25 | dhcp-option=3,<%= dhcp_gw %> |
---|
[511] | 26 | <% end -%> |
---|
| 27 | |
---|
[513] | 28 | <% if dhcp_nameservers != 'absent' -%> |
---|
[536] | 29 | # upstream nameserver |
---|
[513] | 30 | server=<%= dhcp_nameservers %> |
---|
[511] | 31 | <% end -%> |
---|
| 32 | |
---|
[557] | 33 | <% if dhcp_script != 'absent' -%> |
---|
| 34 | # Run an executable when a DHCP lease is created or destroyed. |
---|
| 35 | # The arguments sent to the script are "add" or "del", |
---|
| 36 | # then the MAC address, the IP address and finally the hostname |
---|
| 37 | # if there is one. |
---|
| 38 | dhcp-script=<%= dhcp_script %> |
---|
[511] | 39 | <% end -%> |
---|
[512] | 40 | |
---|
[559] | 41 | <% if dhcp_hostsfile != 'absent' -%> |
---|
| 42 | # This file is puppet here by puppet and the above script is filling |
---|
| 43 | # it with the mac address,<generatedhostname>. This same file is |
---|
| 44 | # also used to assign the static ip and hostname to a specific mac |
---|
| 45 | # address. Take care editing this file. |
---|
[560] | 46 | dhcp-hostsfile=<%= dhcp_hostsfile %> |
---|
[559] | 47 | <% end -%> |
---|
| 48 | |
---|
[512] | 49 | # |
---|
| 50 | # dns configuration |
---|
| 51 | # |
---|
| 52 | |
---|
| 53 | # Never forward plain names (without a dot or domain part) |
---|
| 54 | domain-needed |
---|
| 55 | # Never forward addresses in the non-routed address spaces. |
---|
| 56 | bogus-priv |
---|
| 57 | |
---|
[561] | 58 | <% if addn_hosts != 'absent' -%> |
---|
| 59 | # We want to read another file, as well as /etc/hosts, |
---|
| 60 | # so use this. |
---|
| 61 | addn-hosts=<%= addn_hosts %> |
---|
| 62 | <% end -%> |
---|
| 63 | |
---|
[512] | 64 | <% if domain != 'absent' -%> |
---|
| 65 | # Set this (and domain: see below) if you want to have a domain |
---|
| 66 | # automatically added to simple names in a hosts-file. |
---|
| 67 | expand-hosts |
---|
| 68 | # Set the domain for dnsmasq. this is optional, but if it is set, it |
---|
| 69 | # does the following things. |
---|
| 70 | # 1) Allows DHCP hosts to have fully qualified domain names, as long |
---|
| 71 | # as the domain part matches this setting. |
---|
| 72 | # 2) Sets the "domain" DHCP option thereby potentially setting the |
---|
| 73 | # domain of all systems configured by DHCP |
---|
| 74 | # 3) Provides the domain part for "expand-hosts" |
---|
| 75 | domain=<%= domain %> |
---|
| 76 | <% end -%> |
---|
| 77 | |
---|
[513] | 78 | <% if dhcp_boot != 'absent' -%> |
---|
| 79 | # The file sent to the tftp client, followed by the |
---|
| 80 | # tftp servername and ip |
---|
| 81 | dhcp-boot=<%= dhcp_boot %> |
---|
| 82 | <% end -%> |
---|
[512] | 83 | |
---|
[513] | 84 | <% if tftp_root != 'absent' -%> |
---|
| 85 | # Set the relative root directory for files availble via TFTP. |
---|
| 86 | tftp-root=<%= tftp_root %> |
---|
| 87 | <% end -%> |
---|
[512] | 88 | |
---|
[513] | 89 | <% if log_queries != 'absent' -%> |
---|
| 90 | # For debugging purposes, log each DNS query as it passes through |
---|
| 91 | # dnsmasq. |
---|
| 92 | log-queries |
---|
| 93 | <% end -%> |
---|
| 94 | |
---|
| 95 | <% if log_dhcp != 'absent' -%> |
---|
| 96 | # Log lots of extra information about DHCP transactions. |
---|
| 97 | log-dhcp |
---|
| 98 | <% end -%> |
---|