Sabtu, 26 November 2016

DNS Server Debian 7.2

What's DNS ?

The Domain Name System (DNS) is a hierarchical distributed naming system for computers, services, or any resource connected to the Internet or a private network. It associates various information with domain names assigned to each of the participating entities. Most prominently, it translates easily memorized domain names to the numerical IP addresses needed for the purpose of computer services and devices worldwide. (en.wikipedia.org)

Installation.

in terminal as root, type :

apt-get install bind9


next we will create two databases, namely the reverse and forward.
  1. we entered into a bind directory,    
 type: cd /etc/bind
then type : ls


we will look at some of the existing database files. like this :


bind.keys  db.empty    named.conf.default-zones  zones.rfc1918
db.0       db.local    named.conf.local
db.127       db.root     named.conf.options
db.255       named.conf  rndc.key


Create a database by copying and editing an existing database.
Create a reverse database, type: cp db.127 [db.name].
cp db.127 db.myreverse

Create a forward database, type : cp db.local [db.name].
cp db.local db.myforward

then we see, whether the database has been created by typing ls.  
bind.keys  db.255    db.myforward  named.conf             named.conf.options
db.0       db.empty  db.myreverse  named.conf.default-zones  rndc.key
db.127       db.local  db.root       named.conf.local         zones.rfc1918

 

Now we see that the database has been successfully created (blue text).

then we will do the editing on db.myreverse and db.myforward database, as follows:  

Editing db.myreverse, type : nano db.myreverse

;
; BIND reverse data file for local loopback interface
;
$TTL    604800
@       IN      SOA     stemsa.net. root.stemsa.net. (
                              1         ; Serial
                         604800         ; Refresh
                          86400         ; Retry
                        2419200         ; Expire
                         604800 )       ; Negative Cache TTL
;
@               IN      NS      stemsa.net.
100.168.192     IN      PTR     www.stemsa.net.
 

save and exit by press Ctrl+X

 Editing db.myreverse, type : nano db.myforward

;
; BIND data file for local loopback interface
;
$TTL    604800
@       IN      SOA     stemsa.net. root.stemsa.net. (
                              2         ; Serial
                         604800         ; Refresh
                          86400         ; Retry
                        2419200         ; Expire
                         604800 )       ; Negative Cache TTL
;
@       IN      NS      stemsa.net.
@       IN      A       192.168.100.1
www     IN      A       192.168.100.1
 

 save and exit by press Ctrl+X

  

  1. s
Related Posts Plugin for WordPress, Blogger...