You cannot directly edit /etc/userdomains file without it possibly reverting whenever /scripts/updateuserdomains runs or during certain other processes. As such, this would only be a temporary bandage to an issue with your domain being owned by the wrong user.
If your domain is showing that wrong ownership, first try moving all these files and running /scripts/updateuserdomains afterward:
Code:
mv /etc/userdomains /etc/userdomains.bak
mv /etc/domainusers /etc/domainusers.bak
mv /etc/trueuserdomains /etc/trueuserdomains.bak
Again afterward, then you would run:
Code:
/scripts/updateuserdomains
If the domain is still improperly owned, please go to /var/cpanel/users location and check for the domain name there:
Code:
grep domain.com /var/cpanel/users/*
If it is showing the wrong ownership, remove the domain from the improperly owned file.
Alternatively, if it is showing the wrong ownership due to having previously been the hostname, please go to WHM > Change Hostname and re-change the hostname by following all the steps to do so. Also, go to /var/cpanel/userdata/nobody location and ensure that the domain isn't listed there only the hostname is listed for any files.