Introduction
An important part of managing server configuration and infrastructure includes maintaining an easy way to look up network interfaces and IP addresses by name, by setting up a proper Domain Name System (DNS). Using fully qualified domain names (FQDNs), instead of IP addresses, to specify network addresses eases the configuration of services and applications, and increases the maintainability of configuration files. Setting up your own DNS for your private network is a great way to improve the management of your servers.
In this tutorial, we will go over how to set up an internal DNS server, using the BIND name server software (BIND9) on Ubuntu 14.04, that can be used by your Virtual Private Servers (VPS) to resolve private host names and private IP addresses. This provides a central way to manage your internal hostnames and private IP addresses, which is indispensable when your environment expands to more than a few hosts.
The CentOS version of this tutorial can be found here.
Prerequisites
To complete this tutorial, you will need the following:
- Some servers that are running in the same datacenter and have private networking enabled
- A new VPS to serve as the Primary DNS server, ns1
- Optional: A new VPS to serve as a Secondary DNS server, ns2
- Root access to all of the above (steps 1-4 here)
If you are unfamiliar with DNS concepts, it is recommended that you read at least the first three parts of our Introduction to Managing DNS.
Example Hosts
For example purposes, we will assume the following:
- We have two existing VPS called “host1” and “host2”
- Both VPS exist in the nyc3 datacenter
- Both VPS have private networking enabled (and are on the 10.128.0.0/16 subnet)
- Both VPS are somehow related to our web application that runs on “example.com”
With these assumptions, we decide that it makes sense to use a naming scheme that uses “nyc3.example.com” to refer to our private subnet or zone. Therefore, host1‘s private Fully-Qualified Domain Name (FQDN) will be “host1.nyc3.example.com”. Refer to the following table the relevant details:
Host | Role | Private FQDN | Private IP Address |
---|---|---|---|
host1 | Generic Host 1 | host1.nyc3.example.com | 10.128.100.101 |
host2 | Generic Host 2 | host2.nyc3.example.com | 10.128.200.102 |
Note: Your existing setup will be different, but the example names and IP addresses will be used to demonstrate how to configure a DNS server to provide a functioning internal DNS. You should be able to easily adapt this setup to your own environment by replacing the host names and private IP addresses with your own. It is not necessary to use the region name of the datacenter in your naming scheme, but we use it here to denote that these hosts belong to a particular datacenter’s private network. If you utilize multiple datacenters, you can set up an internal DNS within each respective datacenter.
Our Goal
Continue reading Configure BIND as a Private Network DNS Server on Ubuntu 14.04