-
Notifications
You must be signed in to change notification settings - Fork 0
/
8.sh
28 lines (23 loc) · 616 Bytes
/
8.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/bash
# Define the path to the named.conf file
named_conf="/etc/named.conf"
# Define the logging clause
logging_clause="
logging {
channel simple_log {
file "/var/log/named/bind.log" versions 3 size 5m;
severity dynamic;
print-time yes;
print-severity yes;
print-category yes;
};
category default {
simple_log;
};
};"
# Backup the original named.conf file
cp $named_conf $named_conf.bak
# Append the logging clause to the named.conf file
echo "$logging_clause" >> $named_conf
# Restart the BIND service to apply changes
service named restart