bind.pdf

Upload: badr-tahir

Post on 27-Mar-2016

213 views

Category:

Documents


0 download

TRANSCRIPT

  • ISGI MARRAKECH ABDERRAHIM NASSIR TRI2A

    Configuration Dun Serveur DNS Sous Fedora

    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;

    };

    ################################# rndc key ######################################

  • ISGI MARRAKECH ABDERRAHIM NASSIR TRI2A

    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 ###############################

  • ISGI MARRAKECH ABDERRAHIM NASSIR TRI2A

    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)

    )

    @ NS red02.nassir.lan.

    @ MX 10 red02.nassir.lan.

    www A 1.1.1.1

    red02 A 1.1.1.1

    mail CNAME red02.nassir.lan.

    ##################################################################################

    # 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)

    )

    @ NS red02.nassir.lan.

    1 PTR www.nassir.lan.

    1 PTR red02.nassir.lan.

    ##################################################################################

    # nano /var/named/localhost.zone

    $TTL 86400

    @ IN SOA @ root (

    42 ; serial (d. adams)

    3H ; refresh

    15M ; retry

    1W ; expiry

  • ISGI MARRAKECH ABDERRAHIM NASSIR TRI2A

    1D ) ; minimum

    @ IN NS red02

    Localhost IN A 127.0.0.1

    ##################################################################################

    # 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

    @ IN NS red02

    1 IN PTR 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

  • ISGI MARRAKECH ABDERRAHIM NASSIR TRI2A

    7) . Vrification de la configuration :

    [root@localhost Nassir]#nslookup

    > 1.1.1.1

    Server: 1.1.1.1

    Address: 1.1.1.1#53

    1.1.1.1.in-addr.arpa name = www.nassir.lan.

    > www.nassir.lan

    Server: 1.1.1.1

    Address: 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