How to remove the possibility of changing domain name in DA

Dmitriy Tarasov

Verified User
Joined
Nov 5, 2006
Messages
43
Hello
I’m running free hosting company. All clients supposed to have domains of this type login.domain.tld.
The problem is client can change his domen login.domain.tld in DA to any other name.
How can I prevent it?
Thank you.
 
User can change any subdomain if thats what your providing. Why shouldnt they be allowed to change, delete a subdomain? The way your using DA is not the standard setup. If you dont want them changing the domain you should create subdomain.domain.tld as a domain instead of a subdomain of domain.tld i would imagine thats what your doing.
 
Dmitriy Tarasov said:
Hello
I’m running free hosting company. All clients supposed to have domains of this type login.domain.tld.
The problem is client can change his domen login.domain.tld in DA to any other name.
How can I prevent it?
Thank you.

Create a custom script that is called before attempting to rename domains and make sure it fails (returns non-zero value).

Here is more info Custom script for renaming domain

P.S. Make sure your DA version is 1.232 or later.
 
jlasman said:
How about a custom skin that doesn't allow the change?

That's a good idea indeed, however, this will not prevent a sophisticated DA user from renaming domains with specially crafted URLs and it's more time consuming to implement too.
 
Unfortunately I can not find domain_change_pre.sh or should I create it myself? Where should I place it and with which contents. My DA version number is 1.28.0. OS Red Hat Enterprise Linux ES release 4
 
Dmitriy Tarasov said:
Unfortunately I can not find domain_change_pre.sh or should I create it myself? Where should I place it and with which contents. My DA version number is 1.28.0. OS Red Hat Enterprise Linux ES release 4

Execute the following as root:
Code:
[root@webcart ~]# cat >  /usr/local/directadmin/scripts/custom/domain_change_pre.sh
#!/bin/bash

exit 1;

^D
[root@webcart ~]# chmod 755 /usr/local/directadmin/scripts/custom/domain_change_pre.sh
That's it :)
 
Wonderful! It works.

There was an error while changing that domain name
Details
Abort from custom script: domain_change_pre.sh

Webcart, thank you very much.
 
Dmitriy Tarasov said:
Wonderful! It works.

There was an error while changing that domain name
Details
Abort from custom script: domain_change_pre.sh

Webcart, thank you very much.

You are welcome.
BTW, you could add some user-friendly error message by editing domain_change_pre.sh file as follows:
Code:
#!/bin/bash

echo "Domain name change is not allowed";
exit 1;

Here is how it will be displayed then:
There was an error while changing that domain name



Details

Abort from custom script: domain_change_pre.sh
Domain name change is not allowed
 
For some reason
/usr/local/directadmin/scripts/custom/domain_destroy_pre.sh
with the body

#!/bin/bash

exit 1;

does not work.
Does anyone know why?
domain_destroy_pre.sh chmoded to 755
 
Last edited:
Dmitriy Tarasov said:
For some reason
/usr/local/directadmin/scripts/custom/domain_destroy_pre.sh
with the body

#!/bin/bash

exit;

does not work.
Does anyone know why?
domain_destroy_pre.sh chmoded to 755

I thought it already worked. Did you change anything?
 
yes, domain_change_pre.sh works but not domain_destroy_pre.sh
so user can not change his domain, but he can delete already created domain and after that add his own
 
Well, I've found alternate route. If # of Domains for free host user = 0 he will not be able create his own domain
 
Dmitriy Tarasov said:
Well, I've found alternate route. If # of Domains for free host user = 0 he will not be able create his own domain

Well, if both domain_change_pre.sh and domain_create_pre.sh work fine obeying exit codes, but domain_destroy_pre.sh does not work this way, may I suggest submitting a bug report to DA support? :)
 
Back
Top