Manage a DNS nameserver file
A nameserver ensures that the human-readable URLs you type
in your browser (for example, example.com
) resolve to IP addresses that computers can read. This guide helps
you get started managing a simple Domain Name System (DNS) nameserver file with Puppet.
Before starting this walk-through, complete the previous exercise of setting up NTP management. Log in as root or Administrator on your nodes.
Sysadmins typically need to manage a nameserver file for internal
resources that aren’t published in public nameservers. For example, suppose you have
several employee-maintained servers in your infrastructure, and the DNS network assigned
to those servers use Google’s public nameserver located at 8.8.8.8
. However, there are several
resources behind your company’s firewall that your employees need to access on a regular
basis. In this case, you’d build a private nameserver (for example at 10.16.22.10
), and use Puppet to ensure all the servers in your infrastructure
have access to it.
In this exercise, you learn how to:
-
Write a module that contains a class called
resolver
to manage a nameserver file called/etc/resolv.conf
. -
Enforce the desired state of that class from the command line of your Puppet agent.
For more information about working with Puppet and DNS, see our Dealing with Name Resolution Issues blog post.
Puppet offers many opportunities for learning and training, from formal certification courses to guided online lessons. See the Learning Puppet page for more information.