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

POST CreateHostedZone (Public)

This action creates a public hosted zone, which you use to specify how the Domain Name System (DNS) routes traffic on the Internet for a domain, such as example.com, and its subdomains.

Important

You can't convert a public hosted zone to a private hosted zone or vice versa. Instead, you must 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, which contains metadata about the hosted zone.

For 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 Guide.

When you submit a CreateHostedZone request, the initial status of the hosted zone is PENDING. This means that the NS and SOA records for the hosted zone are not yet available on all Amazon Route 53 DNS servers. When the NS and SOA records are available, the status of the hosted zone changes to INSYNC.

Requests

Syntax

The XML elements in your request must appear in the order listed in the 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/">
   <Name>DNS domain name</Name>
   <CallerReference>unique description</CallerReference>
   <HostedZoneConfig>
      <Comment>optional comment</Comment>
   </HostedZoneConfig>
   <DelegationSetId>optional Amazon Route 53 
      delegation set ID</DelegationSetId>
</CreateHostedZoneRequest>

Headers

The request must include the headers that are required in all Amazon Route 53 requests. For more information, see Common Headers for Actions on Hosted Zones, Resource Record Sets, Health Checks, and Cost Allocation Tags.

Elements

CreateHostedZoneRequest (Required)

A complex type containing the hosted zone request information.

Type: Complex

Default: None

Children: Name, CallerReference, HostedZoneConfig, VPC

Name (Required)

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

Default: None

Parent: CreateHostedZoneRequest

CallerReference (Required)

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

Default: None

Constraints: Allowable characters are any Unicode code points that are legal in an XML 1.0 document. The UTF-8 encoding of the value must be less than 128 bytes.

Parent: CreateHostedZoneRequest

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: Complex

Default: None

Parent: CreateHostedZoneRequest

Children: Comment

Comment (Optional)

Any comments that you want to include about the hosted zone.

Type: String

Default: None

Constraints: Maximum 256 characters

Parent: HostedZoneConfig

DelegationSetId (Optional)

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 Actions on Reusable Delegation Sets.

Type: String

Default: None

Parent: CreatedHostedZoneRequest

Responses

Syntax

HTTP/1.1 201 Created
<?xml version="1.0" encoding="UTF-8"?>
<CreateHostedZoneResponse xmlns="https://route53.amazonaws.com/doc/2013-04-01/">
   <HostedZone>
      <Id>/hostedzone/Amazon Route 53 hosted zone ID</Id>
      <Name>DNS domain name</Name>
      <CallerReference>unique description</CallerReference>
      <Config>
         <Comment>optional comment</Comment>
         <PrivateZone>false</PrivateZone>
      </Config>
      <ResourceRecordSetCount>number of resource record sets 
         in the hosted zone</ResourceRecordSetCount>
   </HostedZone>
   <ChangeInfo>
      <Id>/change/unique identifier for the 
      	change batch request</Id>
      <Status>PENDING | INSYNC</Status>
      <SubmittedAt>date and time in ISO 8601 
         format</SubmittedAt>
   </ChangeInfo>
   <DelegationSet>
      <Id>
      <CallerReference>
      <NameServers>
         <NameServer>DNS name for Amazon Route 53 name server</NameServer>
         <NameServer>DNS name for Amazon Route 53 name server</NameServer>
         <NameServer>DNS name for Amazon Route 53 name server</NameServer>
         <NameServer>DNS name for Amazon Route 53 name server</NameServer>
      </NameServers>
   </DelegationSet>
</CreateHostedZoneResponse>

Headers

The response includes the headers that appear in all Amazon Route 53 responses. For more information, see Common Headers for Actions on Hosted Zones, Resource Record Sets, Health Checks, and Cost Allocation Tags.

Elements

CreateHostedZoneResponse

A complex type containing the response information for the hosted zone.

Type: Complex

Children: HostedZone, ChangeInfo, DelegationSet

HostedZone

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

Type: Complex

Children: Id, Name, VPCs (private hosted zones only), CallerReference, Config, ResourceRecordSetCount

Id (HostedZone)

The ID that Amazon Route 53 assigned to the hosted zone when you created it.

Type: String

Parent: HostedZone

Name

The name of the domain. For public hosted zones, this is the name that you have registered with your DNS registrar.

For information about how to specify characters other than a-z, 0-9, and - (hyphen) and how to specify internationalized domain names, see DNS Domain Name Format.

Type: String

Parent: HostedZone

CallerReference (HostedZone)

The value that you specified for CallerReference when you created the hosted zone.

Type: String

Parent: HostedZone

Config

A complex type that includes the Comment and PrivateZone elements. If you omitted the HostedZoneConfig and Comment elements from the request, the Config and Comment elements don't appear in the response.

Type: Complex

Parent: HostedZone

Children: Comment, PrivateZone

Comment

The comment included in the CreateHostedZoneRequest element.

Type: String

Constraints: Maximum 256 characters

Parent: Config

PrivateZone

A value that indicates whether this is a private hosted zone.

Type: Boolean

Valid Values: true | false

Parent: Config

ResourceRecordSetCount

The number of resource record sets in the hosted zone.

Type: Unsigned long integer

Parent: HostedZone

ChangeInfo

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

Type: Complex

Children: Id, Status, SubmittedAt

Id (ChangeInfo)

The ID of the request.

Type: String

Parent: ChangeInfo

Status

The current state of the request. PENDING indicates that the NS and SOA records associated with this hosted zone have not replicated to all Amazon Route 53 DNS servers.

Type: String

Valid Values: PENDING | INSYNC

Parent: ChangeInfo

SubmittedAt

The date and time the change request was submitted, in Coordinated Universal Time (UTC) format: YYYY-MM-DDThh:mm:ssZ. For more information, see the Wikipedia entry ISO 8601.

Type: Timestamp

Parent: ChangeInfo

DelegationSet

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

Type: Complex

Children: NameServers

Id (DelegationSet)

The ID of the reusable delegation set that you specified in the request, if any. If you didn't specify a reusable delegation set, this element is omitted from the response.

Type: String

Parent: DelegationSet

CallerReference (DelegationSet)

The value that you specified for CallerReference when you created the reusable delegation set. If you didn't specify a reusable delegation set, this element is omitted from the response.

Type: String

Parent: DelegationSet

NameServers

A complex type that contains a list of the authoritative name servers for the hosted zone.

Type: Complex

Parent: DelegationSet

Children: NameServer

NameServer

The name of one of the name servers that is authoritative for your domain.

Type: String

Parent: NameServers

Errors

Amazon Route 53 returns the following errors for this action.

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.

InvalidDomainName

The specified domain name is not valid.

HostedZoneAlreadyExists

The hosted zone you are attempting to create already exists.

Amazon Route 53 returns this error when a hosted zone has already been created with the specified CallerReference.

TooManyHostedZones

This hosted zone cannot be created. The hosted zone limit has been exceeded. To request a limit increase, go to http://aws.amazon.com/route53-request/.

InvalidVPCId

Either no Amazon VPC exists with the value that you specified for VPCId or the user doesn't have permission to associate the specified VPC with the specified hosted zone.

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 if you're creating hosted zones for example.com and test.example.com.

InvalidInput

The input is not valid.

NoSuchDelegationSet

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

Examples

Example Request

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/">
   <Name>example.com</Name>
   <CallerReference>myUniqueIdentifier</CallerReference>
   <HostedZoneConfig>
      <Comment>This is my first hosted zone.</Comment>
   </HostedZoneConfig>
   <DelegationSetId>NZ8X2CISAMPLE</DelegationSetId>
</CreateHostedZoneRequest>

Example Response

HTTP/1.1 201 Created
<?xml version="1.0" encoding="UTF-8"?>
<CreateHostedZoneResponse xmlns="https://route53.amazonaws.com/doc/
2013-04-01/">
   <HostedZone>
      <Id>/hostedzone/Z1PA6795UKMFR9</Id>
      <Name>example.com.</Name>
      <CallerReference>myUniqueIdentifier</CallerReference>
      <Config>
         <Comment>This is my first hosted zone.</Comment>
         <PrivateZone>false</PrivateZone>
      </Config>
      <ResourceRecordSetCount>2</ResourceRecordSetCount>
   </HostedZone>
   <ChangeInfo>
      <Id>/change/C1PA6795UKMFR9</Id>
      <Status>PENDING</Status>
      <SubmittedAt>2014-10-15T01:36:41.958Z</SubmittedAt>
   </ChangeInfo>
   <DelegationSet>
      <Id>NZ8X2CISAMPLE</Id>
      <CallerReference>2014-10-14T11:44:14.448Z</Id>
      <NameServers>
         <NameServer>ns-2048.awsdns-64.com</NameServer>
         <NameServer>ns-2049.awsdns-65.net</NameServer>
         <NameServer>ns-2050.awsdns-66.org</NameServer>
         <NameServer>ns-2051.awsdns-67.co.uk</NameServer>
      </NameServers>
   </DelegationSet>
</CreateHostedZoneResponse>