Deleted subdomain from one user, but Hestia still says it belongs to another account

Hi,

I’m trying to move a subdomain from one Hestia user to another.

Using fictional names:

  • example-main.com is the main domain on the original user

  • app.example-main.com was added there as an additional web domain

  • I later deleted app.example-main.com

  • then created a new user and tried to add app.example-main.com there

Hestia still says the domain belongs to another account.

Important detail:

  • I did not create separate DNS or MX for the subdomain

  • DNS and MX exist only for example-main.com

I checked the server manually and found no active references for the subdomain in the usual locations:

  • no entry in /usr/local/hestia/data/users/*/web*

  • no entry in /home/*/conf/web/

  • no entry in /etc/nginx/

  • no entry in /etc/apache2/

  • no entry in /usr/local/hestia/data/users/*/dns*

  • no entry in /usr/local/hestia/data/users/*/mail*

  • no leftover web directory for the subdomain

The only remaining references are in logs/history and backup metadata:

  • history.log

  • system.log

  • backup.conf

  • backup.log

The logs show the domain was added and later deleted successfully.

I also rebuilt the user and web domains and restarted services, but the issue remains.

Commands already run:

grep -R "app.example-main.com" /usr/local/hestia/data/users/*/web*
grep -R "app.example-main.com" /home/*/conf/web/
grep -R "app.example-main.com" /etc/nginx/
grep -R "app.example-main.com" /etc/apache2/
grep -R "app.example-main.com" /usr/local/hestia/data/users/*/dns*
grep -R "app.example-main.com" /usr/local/hestia/data/users/*/mail*
v-rebuild-user olduser
v-rebuild-web-domains olduser
systemctl restart hestia
systemctl restart nginx
systemctl restart apache2

I do still have a mail account like [email protected] under the parent domain, but that is just an email address and not the same as the subdomain app.example-main.com.

I also have other parent domains and subdomains working under separate users on this same server, so that setup is supported.

Has anyone seen this before? Is there another internal place where Hestia stores domain ownership, or could this be a bug in the ownership check after deleting a subdomain?

Thanks.

Hi,

Could you please show the output of this command?

v-list-sys-config json | jq -r '.[]|.ENFORCE_SUBDOMAIN_OWNERSHIP'

Also, does the domain name contain a dash and is the top-level domain .com? If the answer is no, simulate the actual name using different letters while keeping the top level domain unchanged. Or, even better, provide the actual domain name.

Hi,

Thank you for pointing me to that setting. That helped identify the issue.

I ran the command you suggested:

v-list-sys-config json | jq -r '.[]|.ENFORCE_SUBDOMAIN_OWNERSHIP'

The output was:

yes

After checking this setting, I realized that when ENFORCE_SUBDOMAIN_OWNERSHIP is set to “yes”, Hestia does not allow assigning a subdomain to a different user if the parent domain belongs to another account.

Example (using fictional names):

  • example-main.com is owned by user1

  • I wanted to move app.example-main.com to user2

Even though I deleted app.example-main.com from the first account, Hestia still prevented adding it to another user because the parent domain example-main.com belongs to user1.

To resolve this, I edited the Hestia configuration:

nano /usr/local/hestia/conf/hestia.conf

Then changed:

ENFORCE_SUBDOMAIN_OWNERSHIP='yes'

to:

ENFORCE_SUBDOMAIN_OWNERSHIP='no'

After saving the file, I restarted Hestia:

systemctl restart hestia

After that change, I was able to successfully add the subdomain to the new user account.

Hopefully this helps anyone else who runs into the same issue when trying to move a subdomain to a different user.

Thanks again for the guidance.

3 Likes

Glad you solved it :wink:

Next time you can use this:

v-change-sys-config-value ENFORCE_SUBDOMAIN_OWNERSHIP no
2 Likes