Tout d’abord créer et éditer le fichier suivant :
/etc/bind/log.conf
logging {
channel "requetes" {
file "/var/log/bind/queries.log" size 10m;
print-time yes;
print-category yes;
};
category queries { "requetes"; };
channel "securite" {
file "/var/log/bind/securite.log" size 5m;
print-category yes;
print-severity yes;
print-time yes;
};
category security { "securite"; };
channel "global" {
file "/var/log/bind/global.log" size 5m;
print-category yes;
print-severity yes;
print-time yes;
};
category general { "global"; };
channel "configuration" {
file "/var/log/bind/config.log" size 5m;
print-category yes;
print-severity yes;
print-time yes;
};
category config { "configuration"; };
};
Puis ajouter la ligne suivante dans le fichier :
/etc/bind/named.conf
include "/etc/bind/named.conf.options";
include "/etc/bind/named.conf.local";
include "/etc/bind/named.conf.default-zones";
include "/etc/bind/log.conf";
Créer le dossier et les fichiers qui vont bien :
Dans le dossier /var/log
mkdir /var/log/bind
touch /var/log/bind/queries.log
touch /var/log/bind/securite.log
touch /var/log/bind/global.log
touch /var/log/bind/config.log
On change les droits et propriétaires :
chown -R bind:root /var/log/bind
chmod 775 -R /var/log/bind
On redémarre le service Bind pour la prise en compte des modifications et on regarde le fichier “global.log” se remplir :
service bind9 restart
tailf /var/log/bind/global.log
06-Sep-2018 15:32:55.849 general: error: zone 1.168.192.in-addr.arpa/IN: not loaded due to errors.
06-Sep-2018 15:32:55.850 general: info: zone 127.in-addr.arpa/IN: loaded serial 1
06-Sep-2018 15:32:55.851 general: info: zone 255.in-addr.arpa/IN: loaded serial 1
06-Sep-2018 15:32:55.852 general: info: zone XXXX.local/IN: loaded serial 1
06-Sep-2018 15:32:55.852 general: info: zone XXXX.local/IN: loaded serial 20
06-Sep-2018 15:32:55.854 general: info: zone 5.168.192.in-addr.arpa/IN: loaded serial 15
06-Sep-2018 15:32:55.854 general: info: zone XXXX.local/IN: loaded serial 20
06-Sep-2018 15:32:55.854 general: info: zone localhost/IN: loaded serial 2
06-Sep-2018 15:32:55.854 general: notice: all zones loaded
06-Sep-2018 15:32:55.856 general: notice: running