2

I don't think it's possible but just wanted to know. For example I have a domain and the main website hosted by company A and would like to have a blog managed and hosted with company B. So I need a new subdomain 'blog.mydomain.com'. Can I get the subdomain hosted elsewhere so that company B can easily manage this without having to point the A-record at company A to point to the new host?

2 Answers 2

4

Sub-domains are not purchased or registered. You are free to create one for yourself anytime you like.

Domain names are registered and tied to an IP address. You most likely do this with your registrar.

Sub-domains are created by you in two parts:

  1. In your DNS, again, often the registrar is where this happens, you would create a CNAME (alias) record that points your sub-domain blog.example.com to example.com. If you are not sure how to do this, call the registrar technical support.

  2. On you web server, you create a site blog.example.com. If you are not sure how to do this, call your web host technical support.

You do not have to host your sub-domain using the same host and web server. It is far easier if you do. However, if you do not, then instead of a CNAME, you would use an A record to tie your site blog.example.com to an IP address supplied by the new host.

You may not be able to see your sub-domain right away. It takes time for DNS servers to update. Some query the SOA (statement of authority) for the sub-domain and update immediately, while others query the up-stream DNS or cache entries which may not have been updated yet. So you may have to be patient.

Once you are able to access your sub-domain, you can upload your site or scripts.

1
  • A subdomain does not imply delegation automatically, and as such there may not be any SOA involved at all. Nov 19, 2022 at 17:27
1

@closetonoc answer of using CNAMES is a very common, practical solution to a lot of hosting delegation issues albeit with some limits and gotchas. If its practical you should use it as it is way more common then the solution below.

Below is a more technically correct answer and the way DNS is designed to work. It does assume that both company A and company B support it, which is not a given, as its possible company A will not let you add NS record types for subdomains, and/or its possible company B will tie dns services into domain registrations.

It is not possible to purchase subdomains separately from a different register, as the domain server responsible for the parent domain ultimately controls its subdomains. Of-course, this is as true for "com" or "co.uk" as it is for "example.com" or "example.co.uk". What "com" and "co.uk" do is subdelegate the domain name - and you can do the same with example.com to create xyz.example.com which can be handled independently of example.com - provided the subdelegation for the domain remains in place.

The answer is to set up NS records for xyz.example.com pointing to nameservers, and then creating a zone xyz.example.com at company B.

Lets assume company B has nameservers ns1.b.com and ns2.b.com - in this case, in the DNS setup at Company A for example.com you need to create the nameserver records

xyz     NS  ns1.b.com
xyz     NS  ns2.b.com

That means that whenever someone looks at DNS server A for anything related to xyz.b.com they will be forwarded on to b.com's nameservers.

On b.com you need to set up the zone xyz.example.com

It needs to include all the records you would associated with the domain name, including nameserver records, and A records pointing where you want them to go.

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.