Menu
Amazon Route 53
API Reference (API Version 2013-04-01)

CreateHostedZone

Service: Amazon Route 53

Creates a new public hosted zone, used to specify how the Domain Name System (DNS) routes traffic on the Internet for a domain, such as example.com, and its subdomains.

Important

Public hosted zones cannot be converted to a private hosted zone or vice versa. Instead, create a new hosted zone with the same name and create new resource record sets.

Send a POST request to the /2013-04-01/hostedzone resource. The request body must include an XML document with a CreateHostedZoneRequest element. The response returns the CreateHostedZoneResponse element containing metadata about the hosted zone.

Fore more information about charges for hosted zones, see Amazon Route 53 Pricing.

Note the following:

  • You cannot create a hosted zone for a top-level domain (TLD).

  • Amazon Route 53 automatically creates a default SOA record and four NS records for the zone. For more information about SOA and NS records, see NS and SOA Records that Amazon Route 53 Creates for a Hosted Zone in the Amazon Route 53 Developer Guide.

  • If your domain is registered with a registrar other than Amazon Route 53, you must update the name servers with your registrar to make Amazon Route 53 your DNS service. For more information, see Configuring Amazon Route 53 as your DNS Service in the Amazon Route 53 Developer's Guide.

After creating a zone, its initial status is PENDING. This means that it is not yet available on all DNS servers. The status of the zone changes to INSYNC when the NS and SOA records are available on all Amazon Route 53 DNS servers.

When trying to create a hosted zone using a reusable delegation set, specify an optional DelegationSetId, and Amazon Route 53 would assign those 4 NS records for the zone, instead of allotting a new one.

Request Syntax

POST /2013-04-01/hostedzone HTTP/1.1
<?xml version="1.0" encoding="UTF-8"?>
<CreateHostedZoneRequest xmlns="https://route53.amazonaws.com/doc/2013-04-01/">
   <CallerReference>string</CallerReference>
   <DelegationSetId>string</DelegationSetId>
   <HostedZoneConfig>
      <Comment>string</Comment>
      <PrivateZone>boolean</PrivateZone>
   </HostedZoneConfig>
   <Name>string</Name>
   <VPC>
      <VPCId>string</VPCId>
      <VPCRegion>string</VPCRegion>
   </VPC>
</CreateHostedZoneRequest>

URI Request Parameters

The request does not use any URI parameters.

Request Body

The request requires the following data in XML format.

CreateHostedZoneRequest

Root level tag for the CreateHostedZoneRequest parameters.

Required: Yes

CallerReference

A unique string that identifies the request and that allows failed CreateHostedZone requests to be retried without the risk of executing the operation twice. You must use a unique CallerReference string every time you create a hosted zone. CallerReference can be any unique string, for example, a date/time stamp.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 128.

Required: Yes

DelegationSetId

If you want to associate a reusable delegation set with this hosted zone, the ID that Amazon Route 53 assigned to the reusable delegation set when you created it. For more information about reusable delegation sets, see CreateReusableDelegationSet.

Type

String

Default

None

Parent

CreatedHostedZoneRequest

Type: String

Length Constraints: Maximum length of 32.

Required: No

HostedZoneConfig

(Optional) A complex type that contains an optional comment about your hosted zone. If you don't want to specify a comment, omit both the HostedZoneConfig and Comment elements.

Type: HostedZoneConfig object

Required: No

Name

The name of the domain. For resource record types that include a domain name, specify a fully qualified domain name, for example, www.example.com. The trailing dot is optional; Amazon Route 53 assumes that the domain name is fully qualified. This means that Amazon Route 53 treats www.example.com (without a trailing dot) and www.example.com. (with a trailing dot) as identical.

If you're creating a public hosted zone, this is the name you have registered with your DNS registrar. If your domain name is registered with a registrar other than Amazon Route 53, change the name servers for your domain to the set of NameServers that CreateHostedZone returns in the DelegationSet element.

Type: String

Length Constraints: Maximum length of 1024.

Required: Yes

VPC

The VPC that you want your hosted zone to be associated with. By providing this parameter, your newly created hosted cannot be resolved anywhere other than the given VPC.

Type: VPC object

Required: No

Response Syntax

HTTP/1.1 201
Location: Location
<?xml version="1.0" encoding="UTF-8"?>
<CreateHostedZoneResponse>
   <ChangeInfo>
      <Comment>string</Comment>
      <Id>string</Id>
      <Status>string</Status>
      <SubmittedAt>timestamp</SubmittedAt>
   </ChangeInfo>
   <DelegationSet>
      <CallerReference>string</CallerReference>
      <Id>string</Id>
      <NameServers>
         <NameServer>string</NameServer></NameServers>
   </DelegationSet>
   <HostedZone>
      <CallerReference>string</CallerReference>
      <Config>
         <Comment>string</Comment>
         <PrivateZone>boolean</PrivateZone>
      </Config>
      <Id>string</Id>
      <Name>string</Name>
      <ResourceRecordSetCount>long</ResourceRecordSetCount>
   </HostedZone>
   <VPC>
      <VPCId>string</VPCId>
      <VPCRegion>string</VPCRegion>
   </VPC>
</CreateHostedZoneResponse>

Response Elements

If the action is successful, the service sends back an HTTP 201 response.

The response returns the following HTTP headers.

Location

The unique URL representing the new hosted zone.

Length Constraints: Maximum length of 1024.

The following data is returned in XML format by the service.

CreateHostedZoneResponse

Root level tag for the CreateHostedZoneResponse parameters.

Required: Yes

ChangeInfo

A complex type that describes the changes made to your hosted zone.

Type: ChangeInfo object

DelegationSet

A complex type that describes the name servers for this hosted zone.

Type: DelegationSet object

HostedZone

A complex type that contains general information about the hosted zone.

Type: HostedZone object

VPC

A complex type that contains information about an Amazon VPC that you associated with this hosted zone.

Type: VPC object

Errors

For information about the errors that are common to all actions, see Common Errors.

ConflictingDomainExists

You specified an Amazon VPC that you're already using for another hosted zone, and the domain that you specified for one of the hosted zones is a subdomain of the domain that you specified for the other hosted zone. For example, you cannot use the same Amazon VPC for the hosted zones for example.com and test.example.com.

HTTP Status Code: 400

DelegationSetNotAvailable

You can create a hosted zone that has the same name as an existing hosted zone (example.com is common), but there is a limit to the number of hosted zones that have the same name. If you get this error, Amazon Route 53 has reached that limit. If you own the domain name and Amazon Route 53 generates this error, contact Customer Support.

HTTP Status Code: 400

DelegationSetNotReusable

A reusable delegation set with the specified ID does not exist.

HTTP Status Code: 400

HostedZoneAlreadyExists

The hosted zone you are trying to create already exists. Amazon Route 53 returns this error when a hosted zone has already been created with the specified CallerReference.

HTTP Status Code: 409

InvalidDomainName

The specified domain name is not valid.

HTTP Status Code: 400

InvalidInput

The input is not valid.

HTTP Status Code: 400

InvalidVPCId

The hosted zone you are trying to create for your VPC_ID does not belong to you. Amazon Route 53 returns this error when the VPC specified by VPCId does not belong to you.

HTTP Status Code: 400

NoSuchDelegationSet

A reusable delegation set with the specified ID does not exist.

HTTP Status Code: 400

TooManyHostedZones

This hosted zone cannot be created because the hosted zone limit is exceeded. To request a limit increase, go to the Amazon Route 53 Contact Us page.

HTTP Status Code: 400