Questo contenuto non è disponibile nella lingua selezionata.

Chapter 10. Customizing BIND logging


As Identity Management (IdM) administrator, you can improve visibility and maintain security by customizing where BIND writes its logs and ensuring SELinux allows access to those custom paths.

10.1. Customizing the BIND log path

You can customize the path to your BIND logs by using the ipa-logging-ext.conf file.

Procedure

  1. Open the ipa-logging-ext.conf file in the /etc/named/ directory and add or modify a logging channel with your file path:

    logging {
    	channel ipa_custom_log {
            file "/var/log/named/ipa_dns_queries.log" versions 3 size 10m;
        	severity info;
        	print-time yes;
        	print-severity yes;
        	print-category yes;
    	};
    
    	category queries { ipa_custom_log; };
    	category update { ipa_custom_log; };
    	category update-security { ipa_custom_log; };
    };
    Copy to Clipboard Toggle word wrap
  2. Restart the BIND server:

    # systemctl restart named
    Copy to Clipboard Toggle word wrap

10.2. Extending SELinux policy for BIND custom logging

You can extend the SELinux policy to include the BIND logs.

Procedure

  1. Create a log directory:

    # mkdir -p /var/log/named
    # chown named:named /var/log/named
    # chmod 750 /var/log/named
    Copy to Clipboard Toggle word wrap
  2. Assign the named_log_t SELinux context to the new directory and the log file:

    # semanage fcontext -a -t named_log_t "/var/log/named(/.*)?"
    # restorecon -Rv /var/log/named
    Copy to Clipboard Toggle word wrap
  3. Restart the BIND server:

    # systemctl restart named
    Copy to Clipboard Toggle word wrap

Verification

  • Display your custom log file:

    $ tail -f /var/log/named/ipa_dns_queries.log
    Copy to Clipboard Toggle word wrap
Red Hat logoGithubredditYoutubeTwitter

Formazione

Prova, acquista e vendi

Community

Informazioni sulla documentazione di Red Hat

Aiutiamo gli utenti Red Hat a innovarsi e raggiungere i propri obiettivi con i nostri prodotti e servizi grazie a contenuti di cui possono fidarsi. Esplora i nostri ultimi aggiornamenti.

Rendiamo l’open source più inclusivo

Red Hat si impegna a sostituire il linguaggio problematico nel codice, nella documentazione e nelle proprietà web. Per maggiori dettagli, visita il Blog di Red Hat.

Informazioni su Red Hat

Forniamo soluzioni consolidate che rendono più semplice per le aziende lavorare su piattaforme e ambienti diversi, dal datacenter centrale all'edge della rete.

Theme

© 2026 Red Hat
Torna in cima