This script assumes that the DNS server you are preparing is an empty / fresh installed system with nothing in it.
The script below will check and install the appropriate packages automatically in any EL8 or EL9 system like Rocky Linux, Almalinux, Centos, RHEL or Oracle Linux.
1 2 3 | wget https://repo.nixpal.com/scripts/node-install.sh chmod +x node-install.sh ./node-install.sh |
You can inspect the script or run the commands manually:
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 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 | #!/bin/bash cd # Download curl and wget yum install -y curl wget # Check OS and Firewall rhel_ver=$(awk -F'=' '/VERSION_ID/{ gsub(/"/,""); print $2}' /etc/os-release | awk -F. '{print $1}') if [ $rhel_ver -eq "8" ]; then echo "this is EL" $rhel_ver ". Downloading proper repo" ; wget https://repo.nixpal.com/el8/nixpal-el8-1.1-1.el8.x86_64.rpm yum localinstall nixpal-el8-1.1-1.el8.x86_64.rpm -y fi if [ $rhel_ver -eq "9" ]; then echo "this is EL" $rhel_ver ". Downloading proper repo" ; wget https://repo.nixpal.com/el9/nixpal-el9-1.0-0.el9.x86_64.rpm yum localinstall nixpal-el9-1.0-0.el9.x86_64.rpm -y fi if firewall-cmd --state >/dev/null 2>&1; then echo "firewall-cmd is running" firewall-cmd --zone=public --add-service=dns --permanent firewall-cmd --permanent --add-service=dns firewall-cmd --reload else echo "firewall-cmd is not running or not installed" fi # Named install yum install bind bind-chroot bind-utils -y mkdir /var/named/logs chown named:named /var/named/logs touch /var/named/logs/security.log chown named:named /var/named/logs/security.log touch /var/named/zones.conf touch /var/named/named-logging.conf chown root:named /var/named/zones.conf chown root:named /var/named/named-logging.conf chmod 640 /var/named/zones.conf chmod 640 /var/named/named-logging.conf yum clean all yum install zcloudnode -y /usr/libexec/setup-named-chroot.sh /var/named/chroot on mv /etc/named/named.conf /etc/named.conf.OLD wget -O /etc/named.conf https://repo.nixpal.com/scripts/confs/node-named.conf wget -O /var/named/named-logging.conf https://repo.nixpal.com/scripts/confs/named-logging.conf systemctl enable named-chroot systemctl start named-chroot systemctl enable named --now systemctl enable zcloudnode |
After enabling zcloudnode you should edit the /etc/zcloudnode.conf and add
- The Controller’s URL
- Token from the Controller web interface
- License string from our site
And start it:
1 | systemctl start zcloudnode |
You can check it with status:
1 | systemctl status zcloudnode |