How to set up a DNS server for MooseFS on Debian/Ubuntu

September 19th, 2018 | Wojciech Kostański post_thumbnail

We will show you how to set up a DNS server for MooseFS. It is one of the first steps you should take before the installation.

This article is part of the MooseFS installation guide series:

  1. How to set up a DNS server for MooseFS on Debian/Ubuntu
  2. Things to do before installing MooseFS
  3. How to install MooseFS
  4. MooseFS basic usage

For the purpose of these articles, we will assume that your machines have following IP addresses:

  • Master Servers:
    • Leader:
    • Follower/Metalogger:
  • Chunkservers:
  • Clients (Users’ computers):
    • 192.168.2.x

Using /etc/hosts instead of a DNS server

We recommend using a DNS server instead of writing hosts files on each and every machine.

But if you have only a few machines and you want to test MooseFS, and you really don’t want to set up a DNS, we have a simple guide on how to do it. We will show how to configure it with only one Master server.

You will need to open file/etc/hosts on each host (Masters, chunkservers, and clients) and append:   mfsmaster chunkserver01 chunkserver02 chunkserver03

That’s it! It is super simple and still, we don’t recommend this method.

DNS server for MooseFS setup

The very first thing to do is installing bind9 and DNS utils. You can do this by running the following command:

sudo apt-get install bind9 dnsutils

The second thing you have to do is edit in your favorite editor (e.g. nano or vim) file named /etc/bind/named.conf.local. In this file, you can decide whether it is master or slave server and a select path to zone’s config file. Main configuration files are placed in /etc/bind/ directory. You need to add there your new zone, e.g.:

zone "mfsnetwork.lan" { 
  type master ;
  file "/etc/bind/mfsnetwork.lan"; 

After that create the file you’ve pointed to (here: /etc/bind/mfsnetwork.lan) in the zone configuration (user bind must have permissions to read it) and paste there the following code:

$TTL 3600 
$ORIGIN mfsnetwork.lan.  
@ IN SOA dns.mfsnetwork.lan. root.mfsnetwork.lan. ( 
  2016032900 ; serial number YYYMMDDSS 
  10800 ; refresh 
  3600 ; retry 
  604800 ; expire 
  10800 ; negative TTL 

@ IN NS dns.mfsnetwork.lan. 
@ IN A ; address of bind9 
dns IN A ; address of bind9 

mfsmaster IN A ; address of Master01 
mfsmaster IN A ; address of Master02
mfsmaster01 IN A ; address of Master01 
mfsmaster02 IN A ; address of Master02 

chunkserver01 IN A ; address of Chunkserver01 
chunkserver02 IN A ; address of Chunkserver02 
chunkserver03 IN A ; address of Chunkserver03

Next thing to do is to edit file /etc/bind/named.conf.options. You should use here your ISP’s DNS servers, or you can use OpenDNS servers – IP addresses are presented below:

forwarders {;; 

The last thing to do is to restart the bind9 DNS server to let it load new configuration:

sudo service bind9 restart

Set up a revDNS server

Reverse DNS server is used by MooseFS and all network services, in general, to translate IP addresses to human-readable form (e.g. to mfsmaster01). After you install and properly configure theDNS server you need to do 3 more things to have revDNS set up:

Create an empty file named /etc/bind/ and paste into it the following code:

@ IN SOA dns.mfsnetwork.lan. root.mfsnetwork.lan. ( 
  2016032900 ; serial number YYYYMMDDSS 
) IN NS dns.mfsnetwork.lan. 
1.1 IN PTR mfsmaster01.mfsnetwork.lan. 
2.1 IN PTR mfsmaster02.mfsnetwork.lan. 

101.1 IN PTR chunkserver1.mfsnetwork.lan. 
102.1 IN PTR chunkserver2.mfsnetwork.lan. 
103.1 IN PTR chunkserver3.mfsnetwork.lan.

Add the following code to /etc/bind/named.conf.local file:

zone "" { 
  type master ; 
  file "/etc/bind/rev .168.192.";

Restart bind9 using the following command:

sudo service bind9 restart


After these steps, you are prepared to configure DNS server for MooseFS! You can read more in the next tutorial in this series.