So now that I have my web servers all setup and working I need a way to be able to define URI’s internally (such as FTP, SSH etc) I also wanted to be able to access these sites internally and my modem will not allow hairpin routing so I needed something to direct me to the correct location inside the network. So I needed to setup a DNS server with the correct entries.

First things first is install BIND.

Now that BIND9 is installed the first thing to do is to setup the forwarders. These are the addresses that  we will send any requests that are not defined. i.e. if you dont host it will forward that request onto these servers to get the correct IP. So we edit

And add or modify the following

After the forwarders are setup, we are going to create a folder for the Zone records. A zone is domain that the server will look after. (For example all of the entries related to that domain are grouped together in a zone file.

Now we setup the Zone file for the domain in my case I am setting up so I will create a zone file called

Inside that file I will add the following.

To get started you can copy the existing local zone file and then modify it do this run

The SOA part is quite a thing to wrap your head around. For more information about what is in the file check out After the SOA there is just a single line for each record or sub domain. (In the example above you can see the records for the domain @, accounts, www, dea and ns1)

Now that you have a zone file ready for the domain you need to add it into the named.conf.local

Once you are into the file add the following to the file

After that is done you can restart bind

and then point a DNS client to the server and try to resolve the addresses.

Now you can add the other domains you want to add by repeating the process and pointing other URI’s to different locations around your network.