1. prereqs

source /etc/cid.conf
curl -s http://${rdsserver}/sharel/bin/inst-httpd | sh
curl -s http://${rdsserver}/sharel/bin/inst-mariadb-server | sh

2. web interface

 source /etc/cid.conf
# tarname="$(lftp -c "open http://${rdsserver}/sharel/tar/; find;" | grep 'dhcp' | tail -n1)"
# tarname="$(echo ${tarname:2})"
 tarname="dhcp-20181105.tgz"
 echo ". tarname: ${tarname}"
 curl -s http://${rdsserver}/sharel/tar/${tarname} | tar xz -C /
 wget -N -nv http://${rdsserver}/sharel/etc/httpd/conf.d/dhcp.conf -P /etc/httpd/conf.d/
 cube /etc/httpd/conf.d/dhcp.conf "%dnsdomainname%" with "$(dnsdomainname)"
 cp -puv /opt/dhcp/etc/sudoers.d/http /etc/sudoers.d/
 chown root:root /etc/sudoers.d/http
 chmod 400 /etc/sudoers.d/http
 systemctl reload httpd.service
mysql -u'root' -p'Passw0rd' cid < /opt/dhcp/sql/hosts.sql
Tip either restore the database from a backup or add a first entry with following sample
cid-add-dhcp -h srv002 -i ${ipaddress} -m $(cat /sys/class/net/eth0/address) -c srv002

3. installation

3.1. dns

rpm -q --quiet bind && yum -y remove bind
rpm -q --quiet dnsmasq && systemctl disable dnsmasq.service
rpm -q --quiet bind-utils || yum -y install bind-utils

3.2. dns over https

source /etc/cid.conf
curl http://${rdsserver}/sharel/bin/inst-cloudflare | sh

3.3. dhcp

rpm -q --quiet dhcp || yum -y install dhcp
Tip rpm -q --quiet dhcp-server || yum -y install dhcp-server

4. dhcp configuration

> /etc/dhcp/dhcpd.conf
vi /etc/dhcp/dhcpd.conf
touch /etc/dhcp/dhcpd-hosts.conf
source /etc/cid.conf
wget -N -nv http://${rdsserver}/sharel/etc/dhcp/dhcpd-commit.conf -P /etc/dhcp/
wget -N -nv http://${rdsserver}/sharel/etc/dhcp/dhcpd-wpad.conf -P /etc/dhcp/
systemctl enable dhcpd.service
Tip the dhcpd service will be start later.

5. dns configuration

source /etc/cid.conf
curl -s http://${rdsserver}/sharel/bin/inst-pihole | sh
/bin/cid-updates
/bin/cid-dhcp-dns-hosts-files
systemctl enable pihole-FTL.service
/opt/dhcp/bin/ss-dhcp-dns

5.1. debug

cat /etc/dnsmasq.d/01-pihole.conf
cat /etc/dnsmasq.d/02-cid.conf

6. testing

host d01cid.ddns.net
d01cid.ddns.net has address 84.22.118.78
host 84.22.118.78
78.118.22.84.in-addr.arpa domain name pointer srv001.tilaa.cloud.

7. debuging

cat /etc/dnsmasq.conf
conf-dir=/etc/dnsmasq.d

8. uninstall pihole

sed -i 's/nameserver.*/nameserver 9.9.9.9/' /etc/resolv.conf
systemctl stop pihole-FTL.service
systemctl disable pihole-FTL.service
rm -fr /opt/pihole/
rm -fr /etc/pihole/
rm -fr /etc/.pihole/
rm -f /usr/bin/pihole-FTL
rm -f /usr/local/bin/pihole
rm -fr /var/log/pihole/
rm -f /var/log/pihole*
rm -fr /var/www/html/admin/
rm -fr /var/www/html/pihole/
rm -f /run/systemd/generator.late/pihole-FTL.service
rm -f /etc/cron.d/pihole
rm -f /etc/sudoers.d/pihole
rm -f /etc/rc.d/rc1.d/K50pihole-FTL
rm -f /etc/rc.d/init.d/pihole-FTL
rm -f /etc/rc.d/rc5.d/K50pihole-FTL
rm -f /etc/rc.d/rc4.d/K50pihole-FTL
rm -f /etc/rc.d/rc3.d/K50pihole-FTL
rm -f /etc/rc.d/rc0.d/K50pihole-FTL
rm -f /etc/rc.d/rc2.d/K50pihole-FTL
rm -f /etc/rc.d/rc6.d/K50pihole-FTL
rm -f /etc/dnsmasq.conf
rm -fr /etc/dnsmasq.d/
rm -f /etc/bash_completion.d/pihole
rm -fr /home/pihole/
rm -fr /run/pihole/
rm -f /run/pihole-FTL.port
rm -f /run/pihole-FTL.pid
rm -f /etc/cron.d/pihole
find / -name '*pihole*'

9. references