User guide
Table Of Contents
- AWS SDK for .NET
- Table of Contents
- AWS SDK for .NET Developer Guide
- Getting Started with the AWS SDK for .NET
- Programming with the AWS SDK for .NET
- AWS SDK for .NET Tutorials and Examples
- Managing ASP.NET Session State with Amazon DynamoDB
- Tutorial: Creating Amazon EC2 Instances with the AWS SDK for .NET
- Tutorial: Grant Access Using an IAM Role and the AWS SDK for .NET
- Tutorial: Amazon EC2 Spot Instances
- Creating and Using an Amazon SQS Queue with the AWS SDK for .NET
- Creating an Amazon Route 53 Hosted Zone and Adding Resource Record Sets
- Additional Resources
- Document History

The profile must grant permissions for the actions that you intend to use—the Amazon Route 53
actions in this case. Attempts to call actions that lack permissions will fail. For more information,
see Configuring AWS Credentials (p. 9).
The example uses the default constructor to create the object, which implicitly specifies the application's
default profile and region. Other constructors allow you to override either or both default values.
[2] Create a hosted zone
A hosted zone serves the same purpose as a traditional DNS zone file. It represents a collection of
resource record sets that are managed together under a single domain name.
To create a hosted zone
1. Create a CreateHostedZoneRequest object and specify following request parameters. There
are also two optional parameters that aren't used by this example.
• Name – (Required) The domain name that you want to register, www.example.com for this
example.
This domain name is intended only for examples and can't be registered with a domain name
registrar for an actual site, but you can use it to create a hosted zone for learning purposes.
• CallerReference – (Required) An arbitrary user-defined string that serves as a request ID
and can be used to retry failed requests.
If you run this application multiple times, you must change the CallerReference value.
2. Pass the CreateHostedZoneRequest object to the client object's CreateHostedZone method.
The method returns a CreateHostedZoneResponse object that contains a variety of information
about the request, including the HostedZone.Id property that identifies zone.
[3] Create a resource record set change batch
A hosted zone can have multiple resource record sets. Each set specifies how a subset the domain's
traffic, such as email requests, should be routed.You can update a zone's resource record sets with
a single request. The first step is to package all the updates in a ChangeBatch object. This example
specifies only one update, adding a basic resource record set to the zone, but a ChangeBatch object
can contain updates for multiple resource record sets.
To create a ChangeBatch object
1. Create a ResourceRecordSet object for each resource record set that you want to update. The
group of properties that you specify depends on the type of resource record set. For a complete
description of the properties used by the different resource record sets, see Values that You
Specify When You Create or Edit Amazon Route 53 Resource Record Sets.The example Re-
sourceRecordSet object represents a basic resource record set, and specifies the following
required properties.
• Name – The domain or subdomain name, www.example.com for this example.
• TTL – The amount of time in seconds that the DNS recursive resolvers should cache inform-
ation about this resource record set, 60 seconds for this example.
• Type – The DNS record type, A for this example. For a complete list, see Supported DNS
Resource Record Types.
• ResourceRecords – A list of one or more ResourceRecord objects, each of which contains
a DNS record value that depends on the DNS record type. For an A record type, the record
value is an IPv4 address, which for this example is set to a standard example address,
192.0.2.235.
2. Create a Change object for each for each resource record set, and set the following properties.
• ResourceRecordSet – The ResourceRecordSet object that you created in the previous
step.
Version v2.0.0
66
AWS SDK for .NET Developer Guide
Updating Amazon Route 53 Resource Record Sets