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 Copy linkLink copied to clipboard!
You can customize the path to your BIND logs by using the ipa-logging-ext.conf file.
Procedure
Open the
ipa-logging-ext.conffile in the/etc/named/directory and add or modify a logging channel with your file path:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Restart the BIND server:
systemctl restart named
# systemctl restart namedCopy to Clipboard Copied! Toggle word wrap Toggle overflow
10.2. Extending SELinux policy for BIND custom logging Copy linkLink copied to clipboard!
You can extend the SELinux policy to include the BIND logs.
Procedure
Create a log directory:
mkdir -p /var/log/named chown named:named /var/log/named chmod 750 /var/log/named
# mkdir -p /var/log/named # chown named:named /var/log/named # chmod 750 /var/log/namedCopy to Clipboard Copied! Toggle word wrap Toggle overflow Assign the
named_log_tSELinux context to the new directory and the log file:semanage fcontext -a -t named_log_t "/var/log/named(/.*)?" restorecon -Rv /var/log/named
# semanage fcontext -a -t named_log_t "/var/log/named(/.*)?" # restorecon -Rv /var/log/namedCopy to Clipboard Copied! Toggle word wrap Toggle overflow Restart the BIND server:
systemctl restart named
# systemctl restart namedCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification
Display your custom log file:
tail -f /var/log/named/ipa_dns_queries.log
$ tail -f /var/log/named/ipa_dns_queries.logCopy to Clipboard Copied! Toggle word wrap Toggle overflow