How do you change the domain name under Account Functions?

d-woo

Well-Known Member
Aug 9, 2003
88
0
156
For some time, I have been using my own nameservers on my server using my domain name MyDomain.net, so MyDomain.net has DNS entries.

My hostname is also affiliated, as it is srv.MyDomain.net

I now want to use MyDomain.net, but I was unable to Create an Account via WHM because MyDomain.net already has DNS entries.

So, I created a fictitious domain, MyDomain10.net, with username mydomain and then just modified the following files:

a. /usr/local/apache/httpd.conf

b. /var/cpanel/users/mydomain

by changing "MyDomain10.net" to "MyDomain.net"

I can now access MyDomain.net on the web with no issues.

My problem is this: In WHM under Account Functions the entries for the user mydomain all are associated with the URL MyDomain10.net and not MyDomain.net and Account Functions>>Show Active and Inactive Accounts lists MyDomain10.net as Inactive

How do I change that?
 

WebScHoLaR

Well-Known Member
Dec 14, 2005
508
3
168
Planet Earth
Check /var/cpanel/users/mydomain file and look for DNS= entry. That must be showing MyDomain10.net, change it to MyDomain.net and run the script /scripts/updateuserdomains.

You have root access so if you were getting the error that DNS already exists then you should simply delete the DNS zone from WHM > DNS Functions > Delete A DNS zone. Manually editing the configuration files will mess up other settings.
 

d-woo

Well-Known Member
Aug 9, 2003
88
0
156
You have root access so if you were getting the error that DNS already exists then you should simply delete the DNS zone from WHM > DNS Functions > Delete A DNS zone. Manually editing the configuration files will mess up other settings.
Yes, I have root access. I was somewhat reluctant to delete a DNS zone for MyDomain.net since it was the domain for the nameservers of the entire box...which is why I chose the manual method.

Are you referring to deleting the DNS zone for MyDomain10.net?

If I were to delete the DNS zone for MyDomain.net, then re-add it, would that be okay?
 

WebScHoLaR

Well-Known Member
Dec 14, 2005
508
3
168
Planet Earth
Yes, I have root access. I was somewhat reluctant to delete a DNS zone for MyDomain.net since it was the domain for the nameservers of the entire box...which is why I chose the manual method.
As long as your Nameservers are pointing to the correct Ips at the domain registrar, deleting the dns zone file of the domain on which Nameservers are registered will make no issue for other domains.

Are you referring to deleting the DNS zone for MyDomain10.net?
No, I was saying that if while creating the account for MyDomain.net you got an error that DNS zone file already exists then you would have simply delete the dns zone file for MyDomain.net and create the account instead of creating MyDomain10.net and renaming the entries manually.

If I were to delete the DNS zone for MyDomain.net, then re-add it, would that be okay?
There is no need for it now unless you terminate both domains MyDomain10.net and MyDomain.net and wanted to setup the domain MyDomain.net from start.
 

d-woo

Well-Known Member
Aug 9, 2003
88
0
156
There is no need for it now unless you terminate both domains MyDomain10.net and MyDomain.net and wanted to setup the domain MyDomain.net from start.
Okay...I see...thanks!

The hostname of my server is srv2.mydomain.net

I recently suspended an account, which brought this whole thing to my attention, hence the first post above.

When attempting to access any suspended accounts, the URL redirects to the hostname/suspended.page, so in this case:
http://srv2.mydomain.net/suspended.page which generates a 404 error. Mind you, mydomain.net has had DNS for over a year now, yes for srv2 with an A record to the shared IP of the server.

Although I have followed the instructions in
WHM>>Account Functions >> Modify Suspended Account Page
and copied the contents of the /usr/local/apache/htdocs/suspended.page/ directory as well as everything inside the directory to the /home/mydomain/public_html/ directory (that of the account that your hostname is being redirected to)

I accessed cPanel to add a subdomain, srv2 on mydomain.net and rightly received the following error:

Code:
Error from domain wrapper: Sorry you cannot create a subdomain with the same name as the hostname of this machine (srv2.mydomain.net).
If I could just redirect the suspended page to something other than the hostname I should be okay.

How would I do this?
 

d-woo

Well-Known Member
Aug 9, 2003
88
0
156
You don't need to create a subdomain. You can add DNS entry for hostname from WHM >> DNS Functions >> Add an A Entry for your Hostname.
Thank you WebScholar. I really appreciate your help.

I performed this and will await propagation. However, the srv2 A record already existed for the DNS of MyDomain.net and has for some time.

Interestingly, my hostname is srv2.mydomain.net

I already created http://www.MyDomain.net/srv2/suspended.page

is this the correct path for the suspended page which is redirecting to http://srv2.MyDomain.net/suspended.page?

How do I change the suspended page to some place other than my hostname (srv2.mydomain.net) ?
 

d-woo

Well-Known Member
Aug 9, 2003
88
0
156
For those of you looking for this solution what I did was this.

I already had suspended.page added to MyDomain.net/public_html/
from copying the contents of the /usr/local/apache/htdocs/suspended.page/ directory

then . . .

1. WHM>>Resellers>>Reseller Center
And added MyDomain.net as a reseller.

2. WHM>>Account Information>>List Accounts
And changed the ownership (far right column) of the domain that was suspended from root (srv2.mydomain.net) to MyDomain.net

3. WHM>>Account Functions>>Suspended Accounts
And un-suspended the account in question.

4. WHM>>Account Functions>>Suspended Accounts
And re-suspended the account in question.

Now, when attempting to access the suspended site the redirect is to http://www.MyDomain.net/suspended.page

:)