Creates a new public or private hosted zone. You create records in a public hosted
zone to define how you want to route traffic on the internet for a domain, such as
example.com, and its subdomains (apex.example.com, acme.example.com). You create records
in a private hosted zone to define how you want to route traffic for a domain and its
subdomains within one or more Amazon Virtual Private Clouds (Amazon VPCs).
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.
You can't create a hosted zone for a top-level domain (TLD) such as
.com.
For public hosted zones, 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 Route 53 Creates for a Hosted Zone in the
Amazon Route 53 Developer Guide.
If you want to use the same name servers for multiple public hosted zones, you
can optionally associate a reusable delegation set with the hosted zone. See the
DelegationSetId element.
If your domain is registered with a registrar other than Route 53,
you must update the name servers with your registrar to make Route 53 the DNS
service for the domain. For more information, see Migrating DNS Service
for an Existing Domain to Amazon Route 53 in the
Amazon Route 53 Developer Guide.
When you submit a CreateHostedZone request, the initial status of the
hosted zone is PENDING. For public hosted zones, this means that the NS and
SOA records are not yet available on all Route 53 DNS servers. When the NS and
SOA records are available, the status of the zone changes to INSYNC.
The CreateHostedZone request requires the caller to have an
ec2:DescribeVpcs permission.
When creating private hosted zones, the Amazon VPC must belong to the same
partition where the hosted zone is created. A partition is a group of Amazon Web Services Regions. Each Amazon Web Services account is scoped to one
partition.
The following are the supported partitions:
aws - Amazon Web Services Regions
aws-cn - China Regions
aws-us-gov - Amazon Web Services GovCloud (US) Region
For more information, see Access Management
in the Amazon Web Services General Reference.
Example
Use a bare-bones client and the command you need to make an API call.
The cause of this error depends on the operation that you're performing:
Create a public hosted zone: Two hosted zones
that have the same name or that have a parent/child relationship (example.com
and test.example.com) can't have any common name servers. You tried to create a
hosted zone that has the same name as an existing hosted zone or that's the
parent or child of an existing hosted zone, and you specified a delegation set
that shares one or more name servers with the existing hosted zone. For more
information, see CreateReusableDelegationSet.
Create a private hosted zone: A hosted zone
with the specified name already exists and is already associated with the Amazon
VPC that you specified.
Associate VPCs with a private hosted zone:
The VPC that you specified is already associated with another hosted zone that
has the same name.
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 Route 53 generates this error, contact Customer Support.
The hosted zone you're trying to create already exists. Amazon Route 53 returns this
error when a hosted zone has already been created with the specified
CallerReference.
This operation can't be completed either because the current account has reached the
limit on the number of hosted zones or because you've reached the limit on the number of
hosted zones that can be associated with a reusable delegation set.
For information about default limits, see Limits in the
Amazon Route 53 Developer Guide.
To get the current limit on hosted zones that can be created by an account, see GetAccountLimit.
To get the current limit on hosted zones that can be associated with a reusable
delegation set, see GetReusableDelegationSetLimit.
To request a higher limit, create a
case with the Amazon Web Services Support Center.
Creates a new public or private hosted zone. You create records in a public hosted zone to define how you want to route traffic on the internet for a domain, such as example.com, and its subdomains (apex.example.com, acme.example.com). You create records in a private hosted zone to define how you want to route traffic for a domain and its subdomains within one or more Amazon Virtual Private Clouds (Amazon VPCs).
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.
For more information about charges for hosted zones, see Amazon Route 53 Pricing.
Note the following:
You can't create a hosted zone for a top-level domain (TLD) such as .com.
For public hosted zones, 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 Route 53 Creates for a Hosted Zone in the Amazon Route 53 Developer Guide.
If you want to use the same name servers for multiple public hosted zones, you can optionally associate a reusable delegation set with the hosted zone. See the
DelegationSetId
element.If your domain is registered with a registrar other than Route 53, you must update the name servers with your registrar to make Route 53 the DNS service for the domain. For more information, see Migrating DNS Service for an Existing Domain to Amazon Route 53 in the Amazon Route 53 Developer Guide.
When you submit a
CreateHostedZone
request, the initial status of the hosted zone isPENDING
. For public hosted zones, this means that the NS and SOA records are not yet available on all Route 53 DNS servers. When the NS and SOA records are available, the status of the zone changes toINSYNC
.The
CreateHostedZone
request requires the caller to have anec2:DescribeVpcs
permission.When creating private hosted zones, the Amazon VPC must belong to the same partition where the hosted zone is created. A partition is a group of Amazon Web Services Regions. Each Amazon Web Services account is scoped to one partition.
The following are the supported partitions:
aws
- Amazon Web Services Regionsaws-cn
- China Regionsaws-us-gov
- Amazon Web Services GovCloud (US) RegionFor more information, see Access Management in the Amazon Web Services General Reference.
Example
Use a bare-bones client and the command you need to make an API call.
Param
CreateHostedZoneCommandInput
Returns
CreateHostedZoneCommandOutput
See
input
shape.response
shape.config
shape.Throws
ConflictingDomainExists (client fault)
The cause of this error depends on the operation that you're performing:
Create a public hosted zone: Two hosted zones that have the same name or that have a parent/child relationship (example.com and test.example.com) can't have any common name servers. You tried to create a hosted zone that has the same name as an existing hosted zone or that's the parent or child of an existing hosted zone, and you specified a delegation set that shares one or more name servers with the existing hosted zone. For more information, see CreateReusableDelegationSet.
Create a private hosted zone: A hosted zone with the specified name already exists and is already associated with the Amazon VPC that you specified.
Associate VPCs with a private hosted zone: The VPC that you specified is already associated with another hosted zone that has the same name.
Throws
DelegationSetNotAvailable (client fault)
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 Route 53 generates this error, contact Customer Support.
Throws
DelegationSetNotReusable (client fault)
A reusable delegation set with the specified ID does not exist.
Throws
HostedZoneAlreadyExists (client fault)
The hosted zone you're trying to create already exists. Amazon Route 53 returns this error when a hosted zone has already been created with the specified
CallerReference
.Throws
InvalidDomainName (client fault)
The specified domain name is not valid.
Throws
InvalidInput (client fault)
The input is not valid.
Throws
InvalidVPCId (client fault)
The VPC ID that you specified either isn't a valid ID or the current account is not authorized to access this VPC.
Throws
NoSuchDelegationSet (client fault)
A reusable delegation set with the specified ID does not exist.
Throws
TooManyHostedZones (client fault)
This operation can't be completed either because the current account has reached the limit on the number of hosted zones or because you've reached the limit on the number of hosted zones that can be associated with a reusable delegation set.
For information about default limits, see Limits in the Amazon Route 53 Developer Guide.
To get the current limit on hosted zones that can be created by an account, see GetAccountLimit.
To get the current limit on hosted zones that can be associated with a reusable delegation set, see GetReusableDelegationSetLimit.
To request a higher limit, create a case with the Amazon Web Services Support Center.
Throws
Route53ServiceException
Base exception class for all service exceptions from Route53 service.