I deleted /etc/named.conf file on Directadmin

So you successfully did a blander and deleted named .conf file. We got you, let’s fix that for you.

We will download new file from directadmin with

wget -O /etc/named.conf https://www.directadmin.com/named.conf

Now let’s readd the domains here others it won’t work, but before let’s first delete zone files for domains that don’t exist.

bash <(curl -s https://bash.license.icu/da/delete_inactive_dns_zones_directadmin.sh)

Now readd the domains to named.conf

for i in $(cat /etc/virtual/domains); do echo “zone \”$i\” { type master; file \”/var/named/$i.db\”; };” >> /etc/named.conf done

That should fix your issue, But if you feel lazy today here is a script just run a command and we will check if you deleted named.conf and readd the domains for you.

bash <(curl -s https://bash.license.icu/da/recreate-etc-named.conf.sh)