Start by installing BIND 9, the DNS server software, using the following command: sudo yum install bind bind-utils
Open the BIND configuration file to set options like allowed query IPs: sudo nano /etc/named.conf Add your network and set listen-on and allow-query to your network IP range.
Define your DNS zones by creating zone entries in /etc/named.conf. Add both forward and reverse zones for your domain:
Create the forward zone file to map domain names to IP addresses: sudo nano /var/named/example.com.db
Create the reverse zone file to map IP addresses to domain names: sudo nano /var/named/1.168.192.db Enter PTR records to link IP addresses back to domain names.
Ensure the zone files have correct ownership and permissions so that BIND can access them: sudo chown named:named /var/named/example.com.db
Start the DNS service and enable it on boot. Then test your DNS server: sudo systemctl start named sudo systemctl enable named nslookup example.com