DNS – UNBOUND (ENG)

In this article, we will install and configure a DNS server (Domain Name System) again, this time on Unbound.

PREREQUISITES

  1. A server machine (debian)
  2. A client machine (we can use any operating system for that)

Before doing anything, we will update our 2 machines:

apt-get update && apt-get upgrade

 

CONFIGURATION OF THE SERVER MACHINE

We will start by modify the machine hostname , in the form « MachineName.Domain.tld », to indicate to which domain the machine will belong.

Don’t forget to adapt the hostname of your machine according to your situation.

nano /etc/hostname

1) hostname


Then we will modify the /etc/hosts file so that it does a local name resolution without going through the DNS server.

Add these 2 lines to the file without forgetting to adapt your IP address according to your situation.

nano /etc/hosts

2) hosts



Finally we will modify the file /etc/resolv.conf to indicate to the machine its domain and on which server(s) it will be able to resolve the host names to IP addresses and vice versa.

nano /etc/resolv.conf

3) resolv.conf

 

INSTALLATION AND CONFIGURATION OF UNBOUND

For starters, on the server machine, we will install Unbound.

apt-get install -y unbound

Unlike Bind9, the Unbound configuration is done in a single file.

nano /etc/unbound/unbound.conf

6) unbounnd conf 1

7) unbounnd conf 2


We will now check that our configuration file is correct with the command

unbound-checkconf /etc/unbound/unbound.conf

If your configuration file is correct, the command should return you a similar message:

8) checkconf

If your file is not correct, the command will show you at which line there is an error and why it is not good.


Finally we will restart the unbound service for all changes to take effect.

service unbound restart

CONFIGURATION OF THE CLIENT MACHINE

We will now add the client device to the sio.tp domain and indicate which DNS server it should use so that it can resolve the host name of this domain.

nano /etc/hostname

11) client hostname

nano /etc/resolv.conf

10) client resolv.conf


Once configured, you can now test using the command ping.

ping SrvUnbound (from the client machine)

11) ping srvunbound

ping Client (from the server machine)

12) ping client


There you go! Now, as for the Bind9 server, you can for example connect in SSH with the name of the machine without knowing the IP address.

 

 

SOURCE: https://lucasvidelaine.wordpress.com/unbound/

Publicités

Laisser un commentaire

Entrez vos coordonnées ci-dessous ou cliquez sur une icône pour vous connecter:

Logo WordPress.com

Vous commentez à l'aide de votre compte WordPress.com. Déconnexion /  Changer )

Photo Google+

Vous commentez à l'aide de votre compte Google+. Déconnexion /  Changer )

Image Twitter

Vous commentez à l'aide de votre compte Twitter. Déconnexion /  Changer )

Photo Facebook

Vous commentez à l'aide de votre compte Facebook. Déconnexion /  Changer )

Connexion à %s