Last active
December 30, 2015 03:49
-
-
Save pfigue/7772289 to your computer and use it in GitHub Desktop.
dnsmasq Puppet Manifest to serve a local zone and forward external requests to Google's DNS servers.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package { 'dnsmasq': | |
ensure => present, | |
} | |
$dnsmasq_conf = "no-resolv | |
server=8.8.4.4 | |
server=8.8.8.8 | |
interface=eth0 | |
no-dhcp-interface=eth0 | |
no-hosts | |
addn-hosts=/etc/hosts.acme | |
log-queries | |
log-dhcp" | |
file { '/etc/dnsmasq.conf': | |
ensure => file, | |
owner => 'dnsmasq', | |
group => 'root', | |
mode => '0664', | |
content => $dnsmasq_conf, | |
require => Package['dnsmasq'], | |
} | |
$acme_hosts = " | |
z.z.z.z server2.staging.acme | |
" | |
file { '/etc/hosts.acme': | |
ensure => file, | |
owner => 'root', | |
group => 'root', | |
mode => '0644', | |
content => $acme_hosts, | |
notify => Service['dnsmasq'], | |
} | |
service {'dnsmasq': | |
ensure => 'running', | |
start => '/etc/init.d/dnsmasq start', | |
stop => '/etc/init.d/dnsmasq stop', | |
status => '/etc/init.d/dnsmasq status', | |
require => [ | |
Package['dnsmasq'], | |
File['/etc/dnsmasq.conf'], | |
], | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello, i am learning the dnsmasq from your blog "Configuring dnsmasq to serve my own domain name zone", but i get confused about the content in file
/etc/hosts.acme
,which ip should i use in this file? how to defineserver1.acme
? thank you.