Removing DNS via DNS Administration does not work

Wanabo

Verified User
Joined
Jan 19, 2013
Messages
339
As the title says removing DNS via DNS Administration does not work. This is true for domains that have no Local Data or Local Mail on the server and pointing to an external server. In all other cases removing DNS seems to work ok if the domain is deleted by a DA user on the server.

Error is on both servers Centos 6.6 and Centos 7

Setup:
KVM Centos server + DA
External DNS cluster
Custom scripts in /usr/local/directadmin/scripts/custom

Used this setup provided by my hoster:
How to configure your VPS to use our DNS cluster
You can use the notify feature in bind to transfer the DNS records to our DNS servers.

In bind you should replace this in /etc/named.conf between options {}
allow-transfer { none; };
allow-recursion { localnets; };

with
allow-transfer {x.x.x.x;};
notify yes;
also-notify {x.x.x.x;};
allow-recursion { 127.0.0.1; };
listen-on-v6{any;};
notify-source yourserverip;
transfer-source yourserverip;

Save the configuration and restart bind. Bind will now transfer the DNS records.
For DirectAdmin it is possible to automate this by doing this:

Code:
echo '#!/bin/bash
/usr/bin/wget "https://somednscluster.eu/remove_domain/?domain=$domain" --no-check-certificate -O /dev/null >/dev/null 2>&1' >> /usr/local/directadmin/scripts/custom/domain_destroy_post.sh
echo '#!/bin/bash
/usr/bin/wget "https://somednscluster.eu/remove_domain/?domain=$domain" --no-check-certificate -O /dev/null >/dev/null 2>&1' >> /usr/local/directadmin/scripts/custom/domain_change_post.sh
chown diradmin:diradmin /usr/local/directadmin/scripts/custom/domain_destroy_post.sh
chown diradmin:diradmin /usr/local/directadmin/scripts/custom/domain_change_post.sh
chmod 755 /usr/local/directadmin/scripts/custom/domain_destroy_post.sh
chmod 755 /usr/local/directadmin/scripts/custom/domain_change_post.sh

Don't know this is a bug in DA or there is something wrong with my setup.
 
Not sure if it did work before.

I have two KVM servers. The first is about 18 months in use. The second about a month.
I experienced this problem first on my old server a couple of month ago. I can reproduce this problem on my new server as well.
 
Did some additional testing.

User Level -> Domain Setup -> Add Another Domain
DNS is created and properly passed to the dnscluster.

User Level -> Domain Setup -> Delete Domain
DNS is properly removed from dnscluster.


My problem as described in my opening post is purely with Admin Level -> DNS Administration.
Adding DNS (domain) works ok. DNS is created and properly passed to the dnscluster.
Removing DNS (domain) is faulty. DNS is NOT removed from dnscluster.

I suspect the custom scripts are not executed in case Admin Level -> DNS Administration removing DNS.
Seems to me like a bug in DA.
 
Last edited:
Cause those script are called when a domain is removed from domain admin.

For run the script on DNS Administration, you need to create this scripts too:

dns_delete_post.sh

So:

Code:
echo '#!/bin/bash
/usr/bin/wget "https://somednscluster.eu/remove_domain/?domain=$domain" --no-check-certificate -O /dev/null >/dev/null 2>&1' >> /usr/local/directadmin/scripts/custom/dns_delete_post.sh
chown diradmin:diradmin /usr/local/directadmin/scripts/custom/dns_delete_post.sh
chmod 755 /usr/local/directadmin/scripts/custom/dns_delete_post.sh

Regards
 
Grazie! Thank you! ;)

This seem to fix my problems. Did a test add/remove domain and behavior is as expected.
 
Back
Top