I'm new to WebDev. I don't know much about domains or subdomains. I know I can create subdomains if I buy my own domain but I want to know if I can use subdomains with different hosting.

1 Answer 1


Yes you can. This is done using DNS.

A domain will have various DNS records to tell the internet where they are hosted. For example, the A Record points to where the website is, the MX Record points to where email is hosted. They are generally the most important records, but there are others.

So if you have example.com at a host and the A Record is pointing to, to have your subdomain sub.example.com somewhere else, simply update its A Record to the IP address of that host e.g., and that is where the internet will look for the services for that domain.

Your email could be somewhere completely different (by changing the MX Record), it doesn't matter. However, I run a web hosting business and as I say to my customers "having everything under one roof can help avoid tears and heartache - trust me on this".

  • 2
    "having everything under one roof can help avoid tears and heartache" and creates some other drawbacks at the same time. There is no "one size fits all" solution here. Both separating eggs in multiple baskets OR putting all in same one have drawbacks and advantages. Depending on the other constraints, one set of drawbacks will be more a problem than the other, so it is really a very local and personal decision. For example, no matter what provider you use, it WILL fail at some point for some reasons (technical or not). Mar 27, 2022 at 19:51
  • @PatrickMevzek I have customers that have a domain registered at one service, DNS hosted somewhere else, site hosting at another, email at workspaces, a shop at shopify. I can assure you that there is a bigger issue in trying to untangle this and getting them to remember logins than there will ever be by having everything under one roof. I have lost count of the number of people who have unintentionally had domains expire because they never changed email address on their godaddy (or wherever) account.
    – Steve
    Mar 27, 2022 at 22:21
  • 1
    Again: I don't say this is NEVER a good solution, I am saying it is not ALWAYS a good solution. Of course, for you, as provider, things are far simpler if everything is under your control, that is a given. On the shoes of the customer, again, it has benefits and it has drawbacks. I am just trying to introduce nuance and make people see that there is no "one size fits all" approach there. For any good example you provide of "one single provider for all services is best" I can give you a good example for "one single provider for all services is worst". And the opposite. Mar 27, 2022 at 23:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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