Vous êtes sur la page 1sur 5

IT NISRO

CLUB TUTORIEL INFORMATIQUE

Installation et Configuration de Serveur DNS Sous Linux ( pratique )


Step1: verifier l installation Des packages : # rpm -qa | grep bind Si non installez bind # rpm -ivh bind-9.3.3-7.el5.i386.rpm # rpm -ivh system-config-bind-4.0.3-2.el5.noarch.rpm Step2: configuration des fichiers principales : 1) tlchargez le fichier db.cache contenant les donnes sur les serveurs de noms de la racine depuis l'espace FTP de RS.INTERNIC.NET ou http://www.internic.net/domain/db.cache Dplacez le fichier dans le rpertoire avec le nom /var/named/named.root 2) Le fichier de Configuration principal /etc/named.conf contient la liste des zones (ou domaines) que le serveur DNS doit prendre en charge. ############################# start of /etc/named.conf ############################## // Red Hat BIND Configuration Tool // // Default initial "Caching Only" name server configuration // options { directory "/var/named"; dump-file "/var/named/data/cache_dump.db"; statistics-file "/var/named/data/named_stats.txt"; /* * If there is a firewall between you and nameservers you want * to talk to, you might need to uncomment the query-source * directive below. Previous versions of BIND always asked * questions using port 53, but BIND 8.1 uses an unprivileged * port by default. */ // query-source address * port 53; };

IT NISRO

CLUB TUTORIEL INFORMATIQUE

################################# rndc key ###################################### key rndckey { algorithm hmac-md5; secret "e6tU9kRGybv3wgBFIgkSZw5XAZO64OMwMdmilO5ZzgOVrZpc8YB1hHoi15Pk"; }; controls { inet 127.0.0.1 port 953 allow { 127.0.0.1; } keys { rndckey; }; }; ################################################################################## zone "." IN { type hint; file "named.root"; }; zone "nassir.lan." IN { type master; file "nassir.lan"; allow-update { key "rndckey"; }; }; zone "1.168.192.in-addr.arpa." IN { type master; file "1.1.1.lan"; allow-update { key "rndckey"; }; }; zone "localhost." IN { type master; file "localhost.zone"; allow-update { none; }; }; zone "0.0.127.in-addr.arpa." IN { type master; file "127.0.0.zone"; allow-update { none; }; }; #include "/etc/rndc.key" ############################## End Of named.conf file ###############################

IT NISRO

CLUB TUTORIEL INFORMATIQUE

3) Crez et Configurez les fichiers des zones lists dans /etc/named.conf et placez les dans le reprtoire /var/named # nano /var/named/nassir.lan $TTL 86400 @ IN SOA red02.nassir.lan. root.nassir.lan. ( 43 ; serial 10800 ; refresh (3 hours) 900 ; retry (15 minutes) 604800 ; expire (1 week) 86400 ; minimum (1 day) ) @ @ www mail NS MX A CNAME 10 red02.nassir.lan. red02.nassir.lan. 1.1.1.1 1.1.1.1 red02.nassir.lan.

red02 A

################################################################################## # nano /var/named/1.1.1.lan $TTL 86400 @ IN SOA red02.nassir.lan. root.nassir.lan. ( 69 ; serial 10800 ; refresh (3 hours) 900 ; retry (15 minutes) 604800 ; expire (1 week) 86400 ; minimum (1 day) ) @ 1 1 NS PTR PTR red02.nassir.lan. www.nassir.lan. red02.nassir.lan.

################################################################################## # nano /var/named/localhost.zone $TTL 86400 @ IN SOA @ root (

IT NISRO 42 ; serial (d. adams) 3H ; refresh 15M ; retry 1W ; expiry 1D ) ; minimum @ IN NS IN red02 A 127.0.0.1 Localhost

CLUB TUTORIEL INFORMATIQUE

################################################################################## # nano /var/named/127.0.0.zone $TTL 86400 @ IN SOA red02.nassir.lan. root.nassir.lan. ( 42 ; Serial 28800 ; Refresh 14400 ; Retry 3600000 ; Expire 86400 ) ; Minimum @ 1 IN IN NS PTR red02 localhost.

################################################################################## 4) Editez le fichier /etc/resolv.conf et changez lordre de recherche dns sous /etc/nsswitch.conf # cat /etc/resolv/conf nameserver 1.1.1.1 search nassir.lan changer lordre dans le fichier /etc/nsswitch.conf #hosts: db files nisplus nis dns hosts: dns files 5) Verifier la configuration de fichier /etc/named.conf et des fichiers zones # named-checkconf Ex: # named-checkzone nassir.lan /var/named/nassir.lan 6) Dmarrage de service named # service named restart

IT NISRO

CLUB TUTORIEL INFORMATIQUE

7) . Vrification de la configuration : [root@localhost Nassir]#nslookup > 1.1.1.1 Server: Address: 1.1.1.1 1.1.1.1#53 name = www.nassir.lan.

1.1.1.1.in-addr.arpa > www.nassir.lan Server: Address: 1.1.1.1

1.1.1.1#53

Name: www.nassir.lan Address: 1.1.1.1

[root@localhost Nassir]#dig www.nassir.lan ; <<>> DiG 9.7.3-RedHat-9.7.3-1.fc14 <<>> www.nassir.lan ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 475 ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1 ;; QUESTION SECTION: ;www.nassir.lan. ;; ANSWER SECTION: www.nassir.lan. ;; AUTHORITY SECTION: Nassir.lan. 86400 IN NS red02.nassir.lan. A 1.1.1.1 ;; ADDITIONAL SECTION: Red02.nassir.lan. ;; Query time: 15 msec ;; SERVER: 1.1.1.1#53(1.1.1.1) ;; WHEN: Fri May 6 15:56:21 2011 ;; MSG SIZE rcvd: 87 86400 IN 86400 IN A 1.1.1.1 IN A

Vous aimerez peut-être aussi