Ao usar o AWS re:Post, você concorda com os AWS re:Post Termos de uso

How do I import DNS zone files to Route 53 and troubleshoot the errors I receive when I import the files?

6 minuto de leitura
0

I want to migrate my Domain Name System (DNS) from another service provider. I need to import a DNS zone file to move all the records in an Amazon Route 53 hosted zone but I receive errors.

Short description

Before you start to import your zone file, note the following to avoid errors:

  • The zone file must be in an RFC compliant format.
  • The domain name of the records in the zone file must match the name of the hosted zone.
  • Route 53 supports the $ORIGIN and $TTL keywords. If the zone file includes $GENERATE or $INCLUDE keywords, then the import fails and Route 53 returns an error.
  • When you import the zone file, Route 53 ignores the statement of authority (SOA) record. Any name server (NS) records in the zone file that have the same name as the hosted zone are also ignored.
  • You can import a maximum of 1,000 records.
  • If the hosted zone already contains records that appear in the zone file, then the import process fails, and no records are created.
  • If the name of a record in the zone file includes a trailing dot (example.com.), then the import process interprets the name as a fully qualified domain name. In this case, a Route 53 record with that name is created.
  • If the name of a record in the zone file doesn't include a trailing dot (www), then the import process concatenates that name with the domain name in the zone file (example.com). In this case, a Route 53 record with the concatenated name (www.example.com) is created.
  • Review the contents of the zone file to confirm that record names include or exclude a trailing dot, as needed.

Note: For canonical name (CNAME), mail exchanger (MX), pointer (PTR), and service (SRV) records, the trailing dot behavior also applies to the domain name that's included in the RDATA value. For example, you use a zone file for example.com, and a CNAME record in the zone file with an RDATA value of www.example.com. Neither value has a trailing dot. In this example, the import process creates a Route 53 record with the name: support.example.com. This record routes traffic to www.example.com. Before you import your zone file, review the RDATA values and update the values as applicable.

Resolution

Import a DNS zone file

To import a DNS zone file and create records, complete the following steps:

  1. Open the Route 53 console.
  2. In the navigation pane, choose Hosted zones.
  3. Choose Create hosted zone.
  4. Enter the name of your domain.
    (Optional) Enter a comment.
  5. Choose Create.
  6. Choose Import zone file.
  7. In the Import zone file pane, add the contents of your zone file into the Zone file text box.
  8. Choose Import.

Note: Depending on the amount of records in your zone file, it might take a few minutes for the records to be created.

After the DNS records are created in the Route 53 hosted zone, proceed with the migration process. To complete the migration process, see Making Amazon Route 53 the DNS service for an existing domain.

Troubleshoot errors received when you import a DNS zone file

The following examples provide steps to troubleshoot and resolve common error messages that you might receive when you import DNS zone files.

Expected exactly one of [AliasTarget, all of [TTL, and ResourceRecords], or TrafficPolicyInstanceId], but found none in Change 

This error is caused when there's no time to live (TTL) value specified in a DNS record of the zone file.

Example error message:

"Invalid request: Expected exactly one of [AliasTarget, all of [TTL, and ResourceRecords], or TrafficPolicyInstanceId], but found none in Change with [Action=CREATE, Name=testdomain.com, Type=A, SetIdentifier=null]"

Example zone file:

$ORIGIN testdomain.com
@ A 1.1.1.1
www CNAME example.com

To resolve this error, use the $TTL keyword to assign TTL to all the DNS records. Or, specify a TTL value to individual records, depending on your use case.

$ORIGIN testdomain.com
$TTL 60
@ A 1.1.1.1
www CNAME example.com

-or-

$ORIGIN testdomain.com
@ 60 A 1.1.1.1
www 60 CNAME example.com

The zone file contains too many values for a record with a type of {Record_Type}

You receive this error when multiple values are specified for a particular DNS record in line "m."

Example error message:

"The zone file contains too many values for a record with a type of TXT. 1 values were expected, but 2 values are specified. On line 3. '@ TXT "abc" "xyz"'"

Example zone file:

$ORIGIN testdomain.com
$TTL 60
@ TXT  "abc" "xyz"

To resolve this error, specify multiple TXT record values on separate lines. Be sure to use double quotes ("example value") to enclose each value. For example:

$ORIGIN testdomain.com
$TTL 60
@ TXT "abc" 
@ TXT "xyz"

CharacterStringTooLong (Value is too long) encountered with {Value}

You receive this error when the TXT value string contains more than 255 characters.

Example error message:

"[Invalid Resource Record: 'FATAL problem: CharacterStringTooLong (Value is too long) encountered with '"spf1 +a +mx ip4:1.1.1.1 ip4:2.2.2.2 ip4:3.3.3.3 ip4:4.4.4.4 ip4:5.5.5.5.5 ip4:6.6.6.6 ip4:7.7.7.7 ip4:8.8.8.8 ip4:9.9.9.9 ip4:10.10.10.10 ipv4:11.11.11.11 ip4:12.12.12.12 ip4:13.13.13.13 ip4:14.14.14.14 ip4:15.15.15.15.15 include:spf.abc.com include:_spf.xyz.com ~all"'']"

Example zone file:

$ORIGIN testdomain.com
$TTL 60
www TXT "spf1 +a +mx ip4:1.1.1.1 ip4:2.2.2.2 ip4:3.3.3.3 ip4:4.4.4.4 ip4:5.5.5.5.5 ip4:6.6.6.6 ip4:7.7.7.7 ip4:8.8.8.8 ip4:9.9.9.9 ip4:10.10.10.10 ipv4:11.11.11.11 ip4:12.12.12.12 ip4:13.13.13.13 ip4:14.14.14.14 ip4:15.15.15.15.15 include:spf.abc.com include:_spf.xyz.com ~all"

To resolve this error, split TXT record strings with over 255 characters into multiple text strings within the same record. Be sure to use double quotes ("example value") around each value.

$ORIGIN testdomain.com
$TTL 60
www TXT "spf1 +a +mx ip4:1.1.1.1 ip4:2.2.2.2 ip4:3.3.3.3 ip4:4.4.4.4 ip4:5.5.5.5.5 ip4:6.6.6.6 ip4:7.7.7.7 ip4:8.8.8.8 ip4:9.9.9.9 ip4:10.10.10.10 ipv4:11.11.11.11""ip4:12.12.12.12 ip4:13.13.13.13 ip4:14.14.14.14 ip4:15.15.15.15.15 include:spf.abc.com include:_spf.xyz.com ~all"

Note: The maximum length of a value in a TXT record is 4,000 characters.

RRSet of type CNAME with DNS name example.com does not contain exactly one resource record

You receive this error when multiple CNAME records are created for the same domain name.

Example error message:

"Error occurred [RRSet of type CNAME with DNS name www.testdomain.com. is not permitted as it conflicts with other records with the same DNS name in zone testdomain.com., RRSet of type CNAME with DNS name www.testdomain.com. does not contain exactly one resource record.]"

Note: Records imported to a hosted zone through this method are created with the Simple Routing policy. As a result, multiple CNAME records can't be specified in a single DNS record.

Example zone file:

$ORIGIN testdomain.com
$TTL 60
www CNAME abc.com
www CNAME xyz.com

To resolve this error, create records separately with Weighted, Latency, Failover, or Geolocation routing policies, as appropriate for your use case. Don't use the import option.

AWS OFICIAL
AWS OFICIALAtualizada há 3 meses