This does not work when the hostname and domain name are same. You can verify the below results.
Change the hostname to server.domain.com. Then check the below,
/scripts/whoowns domain.com
cd /etc
mv userdomains userdomains.bak
mv domainusers domainusers.bak
mv trueuserdomains trueuserdomains.bak
/scripts/updateuserdomains
Then check the value from the command.
/scripts/whoowns domain.com
Change the hostname to server.domain.com. Then check the below,
/scripts/whoowns domain.com
cd /etc
mv userdomains userdomains.bak
mv domainusers domainusers.bak
mv trueuserdomains trueuserdomains.bak
/scripts/updateuserdomains
Then check the value from the command.
/scripts/whoowns domain.com