Skip to content

Instantly share code, notes, and snippets.

@pfigue
Last active December 30, 2015 03:49
Show Gist options
  • Save pfigue/7772289 to your computer and use it in GitHub Desktop.
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.
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'],
],
}
@perfectfoolish
Copy link

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 define server1.acme ? thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment