0

I currently have a few websites hosted with a web host, but I want to switch to a better host. I found one that I want to use on a trial basis, transferring one website at a time to it to see how well it works for me before committing fully. Both hosts are shared servers, and I have one primary domain and three add-on domains. All four domains are registered through a third party and I point the name servers to the older host.

My question is, would I likely run into a problem if I were to point the nameserver for the add-on domain before the primary domain? Or vise-versa? For example, if I make an account with the new host and select my existing primary domain as what will be the main domain for the account, but keep the name servers pointed at the old host, would that cause issues? Because, for example, for these servers www.addondomain.com is usually also the same as addondomain.example.com but that latter address wouldn't actually work without example.com being set up.

Or alternatively, if I transfer the name server for the primary domain to the new host before doing so for the add-on domains, might that cause the add-on domains to stop functioning?

To be clear, the domain registrar is staying the same. The web host is what will be changing.

Potentially this is something that the new web host can answer, but I'm looking for a little grounding so I can ask the right questions.

3
  • 1
    "but I'm looking for a little grounding so I can ask the right questions." The problem is that your notions of "primary"/"add-on" domains is nothing standard, the DNS knows nothing about that. All domains are "equal". This is something purely related to your current provider, or the new one, difficult to tell you are not giving real information whatsoever (no real domain names, no details on current or future hoster, etc.) so it is impossible to give you a really fitting answer. Jul 12 at 14:39
  • 1
    @PatrickMevzek Primary and add-on domains are from cPanel. Because so many shared hosting providers use cPanel, primary and add-on domains are fairly standard between shared hosting providers. The distinction has nothing to do with DNS but rather how the directory structure for sites is configured and where Apache's DocumentRoots for the various sites point. You'd think that cPanel would create each of your domains as its own document root, but unfortunately that isn't the case. All but one of your domains (add-on domains) are in sub-directories of your primary domain. Jul 13 at 11:15
  • @StephenOstermiller All is well, thanks (I kind of know that, my comment was more an hint to improve the question), but I believe this merits to be stated when asking a question (and/or using relevant tags) because anything not standard may vary from one hoster to the next so replies may both miss the specific case and future readers might get confused. Jul 13 at 17:39
1

If you new shared host uses cPanel with "add-on domains" the same as your last host, it is generally best to keep the same structure. The same domain should be set as the primary domain and other domains should be add-on domains.

It is possible to rearrange the structure, but then subdomains like addondomain.example.com won't work the same way they used to. If you have been careful to never use those subdomains, or redirect away from them, then rearranging the account could be fine.

You should be able to add your primary domain to your new host before you point your DNS to them. The server configuration at your new host isn't tied to what domains actually point there. So you can:

  1. Add your primary domain to your new host without changing DNS.
  2. Add your add-ons domains to your new host and change their DNS. Either point their A records to your new host from your old host's DNS or change the NS records at your domain registrar to point to your new host.
  3. Switch the DNS for your primary domain to your new host when you are good and ready.
1

All you have to do is point DNS records for the subdomain to your new host.

If all you want is the website at the new host, then just update the IP address in your subdomain's A Record. If you also want to move email, then update the MX Record.

There may be other DNS records that need to be updated e.g. SPF, it all depends on what you are doing with the site.

7
  • Do you mean on the old host update the addon domain's A Record to point to the new host, so that it will work while the primary domain is still directed to the old host?
    – A L
    Jul 12 at 2:34
  • I use Google Apps for the email accounts. The MX Records on the old host point to Gmail. (I assume that I would need to set that on the new host prior to updating the nameservers with the registrar and that there would be no interruption.)
    – A L
    Jul 12 at 2:35
  • Update DNS wherever DNS for example.com (your primary domain) is hosted. It sounds like a cpanel server, so go into the zone editor and do it there, but only update the A Record for your addon domain, don't touch the primary. If your MX record is pointing to google, then nothing else needs to change. Aside: do make sure that in your SPF record you have include:_spf.google.com
    – Steve
    Jul 12 at 2:38
  • Thanks. And then once the primary domain is transferred, the MX records will need to point to Google with the new host too? Would I need to reverify with Google that I manage the domain after I update the name server?
    – A L
    Jul 12 at 2:43
  • 1
    You basically have to replicate the DNS records at the new host, but be sure to do it before you update the nameservers. No, you don't have to reverify as long as you include the same verification method e.g. DNS record, or .html file, at the new server
    – Steve
    Jul 12 at 3:40
0

If the primary and "add-on domains" are separate, eg. example.com and example.org. then this "add on" is purely an artificial construct by your provider.

In the simplest (and typical) case, all 3 domain names should have their own DNS entries. The simplest solution is to make a note of the old A records (and CNAMES if you are modifying them) and update them to point to the new provider. If your provider allows you to set TTLs (time-to-live values) for the records, set these to something low like 300 secs so that you can easily role back if there are issues. If you are happy with your domain registrar there is no need to move domains to another registrar and set everything up again

10
  • I’m only changing hosts, not domain registrar. Would I still need to change things like A records in that case? I thought I just would need to change the entry for name server, and that the host itself takes care of the A records?
    – A L
    Jul 15 at 18:33
  • It is typically a lot easier to change just an A record then change the nameservers of the domain, assuming the registrar is also the DNS provider. Changing an A record has far less impact on the rest of your setup - when you change nameservers you need to ensure all the entries for your dns are recreated - which admittedly can be trivial, but it can also be quite time consuming with risk of errors if your dns is being used for things like domain verification, or you have complex records supporting your email or voip setup or other hidden records.
    – davidgo
    Jul 15 at 19:51
  • I mean the new host will tell me what the name server is, and then I put that in the registrar’s field where the old host’s name server was.
    – A L
    Jul 15 at 19:54
  • I understood what you mean, but I wonder if I am not communicating my message properly. A DNS server typically contains many entries (commonly including A, MX, CNAME and txt records). For things to continue to work properly all the required records need to be set up on the new nameserver - and some of these records may not be easily/programatically discoverable....
    – davidgo
    Jul 15 at 20:24
  • oh okay, but right now all of that is set up on the old host and the registrar is only told the name server. Ultimately I will have to change the name server as I’ll cancel the old host. But you’re saying that for now I can edit the A record on the registrar alone?
    – A L
    Jul 15 at 20:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.