My domain is example.com

I want to add sub domain like subdomain.example.com

My domain register in godaddy. I created Hosted Zone in aws route 53 and changed dns in godaddy. example.com working as i want.

But, now i want to add sub domain in this domain. Bu i don't do this.

I tried first this (site link):

Login to your AWS console.

Click here to go to AWS route53 console. From the left bar click Hosted zones.

From the top bar click Create Hosted Zone. > In the right pane, put subdomain.maindomain.com as the domain name and click Create.

Copy the name servers for this domain for further use.

Now go to the records set for your main domain and click Create Record Set.

In the right pane, put subdomain. in the Name section, choose Type as NS and for Value put the previously copied name servers and then click Create.

But this didn't work.

Then i tried this.

So in that case create a CNAME record where example.com will be canonical name and client.example.com will be alias record.

Once this is done now example.com and client.example.com will both resolve to the same IP address i.e to the Load balancer.

But still didn't work.

How can i do this?

  • For me subdomains means delegating authority to a different name server. If you want everything to be on the same DNS servers (from Godaddy), just start adding A records with dots in them (e.g. "www.subdomain"). If you do want to delegate authority, you should configure the subdomain of the subdomain on that NS server. If you host everything on the webpanel of godaddy, you're not delegating access so just add A records with dots in them. – Tommiie Oct 4 '18 at 13:51
  • Firstly thanks :) i want to manage all in route 53. Also, i can't add any record in main domain in godaddy because i change dns records. GoDaddy don't permission to me for this process. I said above, i tried different way but i couldn't do this. – Hüseyin KÜÇÜK Oct 4 '18 at 14:01
  • Then perhaps I didn't fully understand your question - or the limitations of godaddy. – Tommiie Oct 4 '18 at 14:02

The key trick in setting up a subdomain is linking the subdomain with the parent domain through a set of name servers - NS records. I.e. the subdomain.example.com is known to its set of nameservers (NS records) and the parent domain example.com must know what these NS are for the subdomain. Just like in GoDaddy where you set the example.com's Route53 NS that are then inserted into the .com zone as a link to your domain. Makes sense?

This is how you create a subdomain in Route53:

  1. Create new Hosted Zone subdomain.example.com in Route53 and copy the set of **NS records* to a clipboard or Notepad or somewhere:

    enter image description here

    (I'm using my domain aws.nz for this demo - example.com subdomain can't be created in R53)

  2. The open example.com hosted zone details (or aws.nz in this case) and click Create Record Set. Set:

    • Name: subdomain.example.com
    • Type: NS
    • Value: the list of nameservers from step 1 above.

    enter image description here

  3. Create some record in subdomain, e.g. test.subdomain.example.com=, wait a minute and try to resolve it:

    ~ $ host test.subdomain.aws.nz
    test.subdomain.aws.nz has address

Hope that helps :)


(Sorry, I don't have enough reputation on ServerFault to post comments to get these details.)

What precisely fails about the linked sites instructions?

Here's my stab at the instructions:

1.) Create a hosted zone. This will generally be the primary domain without any subdomains in my experience, contrary to what your linked instructions. (eg: "example.com" will be the hosted zone.)

2.) Creating the hosted zone will give you 4 amazon owned root name servers that you'll have to give to GoDaddy to change from using GoDaddy's DNS to Amazon's. You'll do this somewhere in GoDaddy's website. [NOTE: You can move over any existing DNS entries you had setup in GoDaddy before you do this if you want, just don't forget to. If you forget them, they'll be the four NS entries in your Route53 hosted zone.]

3.) After that you can add records to the hosted zone in Amazon's web interface. The vast majority of them will probably use the "Simple" routing policy.

Footnote: Don't mess with the pre-existing NS or SOA entries that Amazon setup for you in the hosted zone.

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.