• Webconn Technology
    • GPU Server
      • Dedicated GPU Servers with NVIDIA RTX/A100 GPUs for accelerated AI training, rendering, and scientific computing. Features CUDA cores, 24GB-141GB VRAM, and parallel processing. Pre-configured with TensorFlow/PyTorch.

      • nvidia rtx A6000
    • Dedicated Server
      • Experience blazing-fast speeds & ironclad security with your own dedicated server. No shared resources. Fully customizable plans for gaming, e-commerce, and big data. Start now!

      • datacenter
    • Shared Hosting
      • Get user-friendly DirectAdmin shared hosting for your website. Enjoy an intuitive control panel, one-click app installs, and reliable performance. Perfect for blogs, small business sites, and portfolios.

      • shared hosting web
    • Domains
      • Search and register the perfect domain name for your website. Get a memorable .com, .net, .org or niche TLD to start building your brand online. Includes free privacy protection.

    • VPS
      • Experience the power of a dedicated server without the high cost. Our VPS hosting guarantees CPU, RAM, and storage for your site, ensuring optimal performance and stability.

      • data center
  • Blog
  • Dashboard

How to change log files permissions in bind?

Category:

The umask settings are passed down from the parent process to the BIND process. This means that the permissions for all files made by BIND can be restricted.

You need to change the systemd unit file so that “others” can’t read, write, or run any files made by BIND.

Create a directory for drop-ins in /etc/systemd/system/named.service.d:

[root@centos7 ~]# mkdir /etc/systemd/system/named.service.d/

Set the UMask option to 007 in the /etc/systemd/system/named.service.d/umask.conf configuration file. Create a new file if it does not exist. This will make sure that other people can’t read log files, journal files, and other files. The configuration file should have the following.

[Service]
UMask=0007

Instruct systemd to reload information about services.

[root@centos7 ~]# systemctl daemon-reload

Verify that the drop-in was discovered.

[root@centos7 ~]# systemctl status named
named.service - Berkeley Internet Name Domain (DNS)
Loaded: loaded (/usr/lib/systemd/system/named.service; disabled)
Drop-In: /etc/systemd/system/named.service.d
└─umask.conf
...

This will ensure that other users can’t read log files, journal files, and other files.

[root@centos7 ~]# ls -l /var/named/data/
total 4
-rw-rw----. 1 named named 2039 sep 9 10:34 named.run

For CentOS 5 and 6, add the following line to /etc/sysconfig/named to make sure “others” can’t read, write, or run any files made by BIND:

umask 0007

This will make sure that log files, but also any journal files and other are not readable by others.

[root@centos6 ~]# ls -l /var/named/data/
total 4
-rw-rw----. 1 named named 2039 sep 9 10:34 named.run

Leave a Reply