How to set up at Bind9 DNS

How to set up at Bind9 DNS

A DNS is a service that resolves the FQDN(Fully Qualified Domain Name).

In this tutorial, I will teach you how to set up a DNS for your network, using Bind9!

To start, we will make sure our machine is fully updated and upgraded.

Secondly, this will be my network for this article:

  • Domain: sio.tp
  • LAN Network : 192.168.1.0 /24
  • DNS : 192.168.1.107 /24
  • NGINX(Web1): 192.168.1.101 /24

Make sure to change the configuration to yours and remember you can keep track of which IP corresponds to the service in this tutorial by looking here.

And thirdly, remember you can check the syntax of each file with:

Installing Bind9

To start, we’ll install with the apt install command, all the essentials.

If you wish to check if it was correctly installed, type systemctl status bind9.service

Configuring it

Next step is to edit the etc/hostname with your FQDN

Will be the one I use, now edit etc/hosts to associate your FQDN with your IP address.

Now /etc/resolv.conf to specify your machine’s IP address as a DNS.

Network

For Bind9, it uses different configuration file which will happen to be named named.conf.xxxx (xxxx standing for blank) and in /etc/bind/.

The first one to edit is /etc/bind/named.conf.options . This one will specify every rules that your DNS needs to work efficiently.

  • ACL – to specify which network will have access to the DNS.
  • forwarders – your vmbr1 ip to redirect DNS request that are not addressed to you.
  • allow-query – to specify which network will accept requests from this DNS.

DNS Zone configuration

Now edit the /etc/bind/named.conf.local

Now we need to create directories to specify our zones.

Now edit the files to make your configuration.

Every time that you add a container to your Proxmox, you need to specify its name and IP in this file

Verify it and it should look like this:

Reverse DNS zone configuration

We have to create a file on our post.

Once it’s done, you will have to edit it.

Verify it with the usual manner. named-checkzone sio.tp /etc/bind/zones/sio.tp.rev

Now restart the bind service.

Client configuration (Web1)

To use the DNS, you need to specify it’s IP address in etc/resolv.conf

Laisser un commentaire

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *