What DNS entries to use for add-on domains?

C10

Member
Nov 20, 2016
5
1
3
US
cPanel Access Level
Website Owner
Hello, all - new to this forum, and will be grateful for any assistance. Have run several shared-hosting sites and blogs for 15 years or so, but have minimal code experience and am far below the technical level of most people here - hope I'm not wasting the experts' time on a basic question. Have read dozens of forum and company pages on this general topic, and am still mystified, so perhaps answers will help others as well.

I have several live web sites and domain forwarders in one hosting account. Recently consolidated several domains and sites as add-ons to one umbrella domain. Most of the sites stopped working; with one, the index page still shows, but WordPress install is inaccessible except through cPanel file manager. I've sorted out most e-mail issues, so the main problem is site display/browser access.

I am trying to understand DNS Settings -> Advanced Options -> A (Host) entries. Hosting company tech support says that each cPanel hosting account gets a unique shared hosting IP address, which should be entered as the A (Host) DNS record for any site aimed at that domain - both same-name and forwarded. So here's a hypothetical setup:

cPanel for maindomain.com shows IPA 999.999.999.999
so I set DNS server(s) at maindomain.com domain page to 999.999.999.999

Then add on 2 domains: add1.com and add2.com
add1.com cPanel shows IPA 111.111.111.111
add2.com cPanel shows IPA 222.222.222.222

maindomain.com domain DNS list now shows 3 users:
maindomain.com
add1.maindomain.com
add2.maindomain.com


Questions:

1. What to set as DNS servers for add1.com and add2.com? Both to 999.999.999.999 to match the maindomain.com cPanel IPA, or each to match its site's cPanel IPA?

2. How to set the maindomain.com DNS for each user (i.e., each add-on domain)?

3. When the A (Host) list has a whole bunch of entries, e.g.

add1.com 86400 (1 Day)
autoconfig.add1.com 14400 (4 Hours)
autodiscover.add1.com 14400 (4 Hours)
cpanel.add1.com 14400 (4 Hours)
ftp.add1.com 14400 (4 Hours)
localhost.add1.com 14400 (4 Hours)
webdisk.add1.com 14400 (4 Hours)
webmail.add1.com 14400 (4 Hours)
whm.add1.com 14400 (4 Hours)
add1.com

should they all be set to the same IPA?

4. If a site runs but WordPress doesn't, could that have anything to do with DNS settings, or is it a coincidental problem perhaps resulting from the hosting change?

5. Could any of this relate to .htaccess settings? I've worked (clumsily) with .htaccess files for WP installations, but never for regular web sites. And some of the non-WP sites in question seem to have minimal .htaccess files - much smaller those my WP installations seem to get (mainly from all the stuff added by plugins).

I have tried each variation of IPAs in each location, and results are not great so far. So any help will be very much appreciated.

Thanks in advance!
Code:
grep '' /etc/redhat-release /usr/local/cpanel/version /var/cpanel/envtype ; grep CPANEL= /etc/cpupdate.conf ; httpd -v ; php -v ; mysql -V
 

Infopro

Well-Known Member
May 20, 2003
17,075
524
613
Pennsylvania
cPanel Access Level
Root Administrator
Twitter
1) Same as the main domain
2) When adding an addon domain to the main domain account, it is setup for you automagically
3) Under normal circumstances you shouldn't need to touch this
4) Question is unclear. If you had a wordpress installed on an addon domain and then moved it, you'll need to update your wordpress configuration to use the proper domain name.
5) If in doubt, rename the htaccess tp htaccess.txt to kill it, and see if the site starts to work again properly.
Hosting company tech support says that each cPanel hosting account gets a unique shared hosting IP address
This is incorrect. One shared IP address can have thousands of cPanel hosting accounts on it.

Assuming you have maindomain setup properly on the server, and at your Domain Name Registrar, any addon domains you add to that maindomain cPanel account, will need to be configured at your Domain Name Registrar to use the same nameservers that maindomain uses. Once those nameservers are set at the Registrar for each addon domain, you'd add the addon domain to your account normally, and that's it.
 

C10

Member
Nov 20, 2016
5
1
3
US
cPanel Access Level
Website Owner
Thank you, infopro. Forgive my ignorance...

2) When adding an addon domain to the main domain account, it is setup for you automagically
Sorry - didn't mean "how to enter the data" but "what settings to choose." At the moment, all users have the same IPA as maindomain.com, rather than the unique cPanel IPA of the user domain.

3) Under normal circumstances you shouldn't need to touch this
And I'd rather not! But things aren't working, and I notice that each of the added domains has a completely different set of IPAs for each of those many entries. So I wondered if making them all the same might help.

4) Question is unclear. If you had a wordpress installed on an addon domain and then moved it, you'll need to update your wordpress configuration to use the proper domain name.
WP was working fine when the domain was independent. When I made it an add-on to maindomain.com, it disappeared. So WP is still installed under the same domain name, and the index page (add2.com) works, but the blog URL (add2.com/myblog) gives a 404 error. Is that a more useful description?

Again, thanks.
 

Infopro

Well-Known Member
May 20, 2003
17,075
524
613
Pennsylvania
cPanel Access Level
Root Administrator
Twitter
At the moment, all users have the same IPA as maindomain.com, rather than the unique cPanel IPA of the user domain.
I'd assumed your maindomain is the cPanel user account. If that cPanel user's account has a dedicated IP address, all addon domains would be associated with that account, and that dedicated IP address. If the cPanel users account does not have it's own dedicated IP, then it, and all addon domains on that one cPanel account, would be on the shared IP your Hosting Provider set the cPanel account up with.

and I notice that each of the added domains has a completely different set of IPAs for each of those many entries. So I wondered if making them all the same might help.
As mentioned, you shouldn't need to modify anything there when adding an addon domain to the existing cPanel account. The system should have used the IP address that your cPanel account uses already. I'm unclear with the existing details here as to why they'd be different.

You do not have root access to the server, correct?
You do have a cPanel account, do you know if your account with your Hosting Provider comes with additional IPs that you're permitted to use? If so, how many?

When you stated:
Recently consolidated several domains and sites as add-ons to one umbrella domain.
How was that done exactly? Those details might help in explaining things a bit more clear.


So WP is still installed under the same domain name, and the index page (add2.com) works, but the blog URL (add2.com/myblog) gives a 404 error. Is that a more useful description?
Possibly. Assuming /myblog/ is not a directory, or a file, it sounds like your htaccess has some rewrite rules setup to create shorter URLs for SEO or something. Try renaming the htaccess to kill it off for a moment and go to your blog's real URL (add2.com/blogsindexpage.php) to see if it opens.

You might use these details as a check list to go thru and make sure all of your settings for the site are already correct:
Changing The Site URL « WordPress Codex
 

C10

Member
Nov 20, 2016
5
1
3
US
cPanel Access Level
Website Owner
As mentioned, you shouldn't need to modify anything there when adding an addon domain to the existing cPanel account. The system should have used the IP address that your cPanel account uses already. I'm unclear with the existing details here as to why they'd be different.
I have no idea - that's just how they showed up! One possibility: these domains have a diverse history: some newly created, some hosted for several years by the current company, some formerly hosted by companies bought by the current host, some transferred in from other companies. They seem to carry legacy pricing, setup (all the cPanels look a little different), and perhaps other internal structures that I wouldn't understand. This is one reason I wanted to get them all co-located as add-on domains to one new umbrella domain, hoping it would make management much easier. So far, actually managing the domains *is* easier - except that the add-on ones don't work! (Those I merely moved to this host but haven't wrapped in as addons to maindoman.com are performing just fine, and cPanels work like a champ.)

You do not have root access to the server, correct?
You do have a cPanel account, do you know if your account with your Hosting Provider comes with additional IPs that you're permitted to use? If so, how many?
I do not have root access, AFAIK, nor option of additional IPs. If useful, I can PM you with real site/domain details - as the forum FAQ suggests, I'd rather not publish them.

When you stated: "Recently consolidated several domains and sites as add-ons to one umbrella domain." How was that done exactly? Those details might help in explaining things a bit more clearly.
It was simple: just bought one new domain and unlimited (?) hosting plan, went to that domain's management page in my shared-hosting account, clicked the Addon Domains tab, entered New Domain names (all already up and running), Directory, FTP Username and Password. Importing then took a few seconds per domain. I assumed that any needed settings would be adjusted automagically, but apparently they weren't - and I've spent a couple of hours chatting with host company's Tech Support without getting much working again except some of the e-mail forwarders.

Assuming /myblog/ is not a directory, or a file, it sounds like your htaccess has some rewrite rules setup to create shorter URLs for SEO or something. Try renaming the htaccess to kill it off for a moment and go to your blog's real URL (add2.com/blogsindexpage.php) to see if it opens.
You might use these details as a check list to go thru and make sure all of your settings for the site are already correct:
Changing The Site URL « WordPress Codex
These were great suggestions, for which many thanks. I tried killing .htaccess, which didn't help. Then tried a couple of the safer-looking items in the WP Codex article, also w/o luck. Couldn't get phpMyAdmin to open, which kind of suggests that it's become unstuck from the domain. Is there a way to access and edit databases (to check/correct the blog's URL) without using phpMyAdmin?

I am very grateful for help so far, and will appreciate more if I'm not abusing your generosity.
 
Last edited:

Infopro

Well-Known Member
May 20, 2003
17,075
524
613
Pennsylvania
cPanel Access Level
Root Administrator
Twitter
Not at all, happy to help. :)

Using a site like intodns.com, you might be able to find out your domain and nameserver IPs for the cPanel account, assuming that its setup properly. Those nameservers should also be used on the addon domains at the Registrar.

Importing then took a few seconds per domain.
How did you import them? Are you speaking of moving the files for the addon from the old account to this new account?

Couldn't get phpMyAdmin to open
You must login to cPanel first, and then go to phpMyAdmin from there. If this isn't working properly, try clearing your browser cache, cookies for your cPanel and try again to see if that helps with this.
 

C10

Member
Nov 20, 2016
5
1
3
US
cPanel Access Level
Website Owner
How did you import them? Are you speaking of moving the files for the addon from the old account to this new account?
OK, I think this may be my mistake. (Or one of them!) I just used the cPanel Addon Domain tool, thinking that it would import all of add1.com and add2.com's content into maindomain.com.

Instead, the top File Manager level - /home/maindomaincom (where maindomaincom is my maindomain.com username) - contains directories like [email protected] and [email protected] (where add1 and add2 are my addon domain usernames). These directories are empty.

So I presumably need to move all the content from each added site from its own cPanel setup into its new sub-directory in maindomain.com's cPanel. Is there an easy way to do this from site backups? Is there some drag-and-drop method? For some reason, I'm not finding much on this via Google.

Thanks!
 

C10

Member
Nov 20, 2016
5
1
3
US
cPanel Access Level
Website Owner
... Questions:
1. What to set as DNS servers for add1.com and add2.com? Both to 999.999.999.999 to match the maindomain.com cPanel IPA, or each to match its site's cPanel IPA?

2. How to set the maindomain.com DNS for each user (i.e., each add-on domain)?

3. When the A (Host) list has a whole bunch of entries ... should they all be set to the same IPA?

4. If a site runs but WordPress doesn't, could that have anything to do with DNS settings, or is it a coincidental problem perhaps resulting from the hosting change?

5. Could any of this relate to .htaccess settings?
OK, eveything now working. In case it helps someone else, will answer my own questions. No guarantees that answers are correct, but it does work!

1/2. Set all DNS servers to match maindomain.com IP address. (This may have to do with this host having its own interface - "CHI" - which I find quite easy to use.)

3. Yes, exception: when setting up domain forwarding, system demands to add one additional DNS listing with a different IP address. I allowed this, and it seems to work fine.

4. Coincidental problem, at least for me. I did not understand how to import a "live" WordPress SQL database into a new database in a same-name, same-URL site on a different server. This was complicated by my large database, exceeding cPanel's 50 MB limit for direct upload. I ended up making a new empty DB in maindomain's cPanel "MySQL Databases" section, pushing the old DB to my public_html directory, unzipping it, and asking the hosting company's tech support to import it into the empty DB. They did, and after suitable updates to username etc., it works perfectly.

5. I tried deactivating .htaccess (by changing its name) and also adding code suggested in various forums. Nothing worked, but problem was solved in #4 anyway.

Thanks for advice, and again, I hope this helps others.
 
  • Like
Reactions: Infopro