hdctest

Member
Nov 9, 2006
9
0
151
I have a server where the domain is being removed from /etc/userdomains at night for some reason.

Mail client responds:
Mail server
mail.domain.com responded: Sorry cannot find an owner for that
domain (domain.com)

I add the domain back to /etc/userdomains to fix the issue.

The server is using an old fedora 2 and cpanel version 11.3.0

Any suggesstions?
 

fi77i

Well-Known Member
Aug 20, 2008
57
0
56
Uruguay
cPanel Access Level
Root Administrator
You can set the file inmutable to prevent the domain to be removed.
The issue here is every time cpanel need to write something in there it won't work.
You need to set inmutable to off and the set it on again.

The command is:

chattr +i /etc/userdomains

and the following to set it off

chattr -i /etc/userdomains
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
41
348
somewhere over the rainbow
cPanel Access Level
Root Administrator
This suggestion is not the better way to handle this happening. The file cannot be set immutable unless you don't want any other domains ever added to it, breaking adding new accounts, addon domains, parked domains and subdomains.

Additionally, manually re-adding domains to /etc/userdomains isn't a good method to get a domain working.

First of all, move all these files and regenerate them properly without these manual edits:

Code:
mv /etc/userdomains /etc/userdomains.bak
mv /etc/domainusers /etc/domainusers.bak
mv /etc/trueuserdomains /etc/trueuserdomains.bak
/scripts/updateuserdomains
If that script when run mentions any domain missing or conflicting due to another user owning it, then that's the issue. You'd then want to go to /var/cpanel/users location and remove the domain from the user's file that shouldn't be owning it and re-run "/scripts/updateuserdomains" again.
 

hdctest

Member
Nov 9, 2006
9
0
151
Ok, I had to contact support. They found the server hostname was the same as the domain that was having the issue and that was the cause. I updated the hostname. Have to wait till tomorrow to verify it works.
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
41
348
somewhere over the rainbow
cPanel Access Level
Root Administrator