Vous n'êtes pas identifié(e).
L'icône rouge permet de télécharger chaque page du wiki visitée au format
PDF et la grise au format ODT →
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentes Révision précédente Prochaine révision | Révision précédente Prochaine révision Les deux révisions suivantes | ||
utilisateurs:hypathie:tutos:dns-bind [31/08/2014 11:39] Hypathie [Introduction au DNS] |
utilisateurs:hypathie:tutos:dns-bind [31/08/2014 13:10] Hypathie [Générer une clé d'authentification avec l'utilitaire rndc] |
||
---|---|---|---|
Ligne 175: | Ligne 175: | ||
192.168.0.14 serveur-debian.mondomaine.hyp serveur-debian | 192.168.0.14 serveur-debian.mondomaine.hyp serveur-debian | ||
- | 192.168.0.22 debian/mondomaine.hyp debian | + | 192.168.0.22 debian.mondomaine.hyp debian |
192.168.0.1 gateway.modomaine.hyp gateway | 192.168.0.1 gateway.modomaine.hyp gateway | ||
Ligne 223: | Ligne 223: | ||
<code root>service networking stop</code> | <code root>service networking stop</code> | ||
- | <code root>cp /etc/NetworkManager/NetworkManager.conf.OLD /etc/NetworkManager/NetworkManager.conf</code> | + | <code root>cp /etc/NetworkManager/NetworkManager.conf.OLD\ |
+ | /etc/NetworkManager/NetworkManager.conf</code> | ||
<code root>service networking start</code> | <code root>service networking start</code> | ||
</note> | </note> | ||
Ligne 238: | Ligne 239: | ||
===Configuration de bind pour un serveur DNS maître local=== | ===Configuration de bind pour un serveur DNS maître local=== | ||
- | note tip> | + | <note tip> |
__Quelques commandes utiles lors de la configuration de bind9__ : | __Quelques commandes utiles lors de la configuration de bind9__ : | ||
Ligne 555: | Ligne 556: | ||
-> Le retour de cette commande a deux parties ;\\ | -> Le retour de cette commande a deux parties ;\\ | ||
- | -> Copier de "# Start of rndc.conf" à "# End of rndc.conf"\\ | + | -> Copier la première partie du retour\\ |
dans les fichiers **''/etc/rndc.conf''** et **''/etc/rndc.key''** (qu'il faut créer). | dans les fichiers **''/etc/rndc.conf''** et **''/etc/rndc.key''** (qu'il faut créer). | ||
- | -> Copier dans **''/etc/named.conf''** les directives entre "# Use with the following in named.conf, adjusting the allow list as needed:" et "# End of named.conf".\\ Bien sûr il faut dé-commenter en enlevant "#".\\ | + | -> Copier dans **''/etc/named.conf''** la deuxième partie du retour.\\ |
Ligne 570: | Ligne 571: | ||
}; | }; | ||
- | options { | + | #options { |
- | default-key "rndc-key"; | + | # default-key "rndc-key"; |
- | default-server 127.0.0.1; | + | # default-server 127.0.0.1; |
- | default-port 953; | + | # default-port 953; |
- | }; | + | #}; |
# End of rndc.conf</code> | # End of rndc.conf</code> | ||
Ligne 589: | Ligne 590: | ||
}; | }; | ||
- | controls { | + | # controls { |
- | inet 127.0.0.1 port 953 | + | # inet 127.0.0.1 port 953 |
- | allow { 127.0.0.1; } keys { "rndc-key"; }; | + | # allow { 127.0.0.1; } keys { "rndc-key"; }; |
- | }; | + | # }; |
# End of named.conf | # End of named.conf | ||
</code> | </code> | ||
- | <note> | ||
- | *Vérifier la configuration : | ||
- | |||
- | <code root>named-checkconf /etc/named.conf<code> | ||
- | >Tout est bon, s'il y a retour du prompt. | ||
- | |||
- | Et | ||
- | |||
- | <code root>named-checkconf /etc/named.conf<code> | ||
- | >Là aussi, retour du prompt. | ||
- | </note> | ||
- | |||
- | * Redémarrer le service nommé. | ||
- | <code root>rndc reload</code> | ||
===Configuration de /etc/bind/named.conf === | ===Configuration de /etc/bind/named.conf === | ||
Ligne 615: | Ligne 602: | ||
<code root>vim /etc/bind/named.conf</code> | <code root>vim /etc/bind/named.conf</code> | ||
<code> | <code> | ||
- | // This is the primary configuration file for the BIND DNS server named. | ||
- | // | ||
- | // Please read /usr/share/doc/bind9/README.Debian.gz for information on the | ||
- | // structure of BIND configuration files in Debian, *BEFORE* you customize | ||
- | // this configuration file. | ||
- | // | ||
- | // If you are just adding zones, please do that in /etc/bind/named.conf.local | ||
- | |||
include "/etc/bind/named.conf.options"; | include "/etc/bind/named.conf.options"; | ||
include "/etc/bind/named.conf.local"; | include "/etc/bind/named.conf.local"; | ||
- | include "/etc/bind/named.conf.default-zones"; | + | //include "/etc/bind/named.conf.default-zones"; |
include "/etc/rndc.key"; | include "/etc/rndc.key"; | ||
controls { | controls { | ||
- | inet 127.0.0.1 allow { localhost; } keys { "xxxxxxxxxxxxx"; }; | + | inet 127.0.0.1 allow { localhost; } keys { "rndc-key"; }; |
}; | }; | ||
+ | </code> | ||
+ | |||
+ | ===Créer /etc/bind/rndc.conf et /etc/bind/rndc.key=== | ||
+ | |||
+ | <code root>cp /etc/rndc.conf /etc/bind/rndc.conf | ||
</code> | </code> | ||
- | *Relancer bind : | + | |
+ | <code root>cp /etc/rndc.key /etc/bind/rndc.key</code> | ||
+ | |||
+ | ===Relancer bind === | ||
<code root>service bind9 restart</code> | <code root>service bind9 restart</code> | ||
+ | <code>[....] Stopping domain name service...: bind9WARNING: key file (/etc/bind/rndc.key) exists, but using default configuration file (/etc/bind/rndc.conf) | ||
+ | rndc: no server specified and no default | ||
+ | . ok | ||
+ | [ ok ] Starting domain name service...: bind9. | ||
+ | </code> | ||
+ | <note> | ||
+ | *Vérifier la configuration : | ||
+ | |||
+ | <code root>named-checkconf /etc/named.conf</code> | ||
+ | >Tout est bon, s'il y a retour du prompt. | ||
+ | |||
+ | </note> | ||
+ | |||
+ | * Redémarrer le service nommé. | ||
+ | <code root>rndc reload</code> | ||
<note tip> | <note tip> | ||
Pour un server distant\\ | Pour un server distant\\ |