Locate the BIND configuration file within the operating system. The BIND configuration file is usually located in one of the following paths:
/etc/bind/named.conf
/etc/named.conf
Open the named.conf file in your preferred editor.
Add the following details to the Options section:
allow-transfer {"none";};
allow-recursion {"none";};
recursion no;
Restart the service.