SOA-C02 Question 250
Single answerYou are setting up a new Route 53 hosted zone for a domain your company recently purchased: example.com. The company wants the website to be accessible globally and hosted on an EC2 instance in a single AWS Region. You have already created the hosted zone in Route 53 and configured the domain's registrar to point to the Route 53 name servers. What type of Route 53 record should you create to ensure the domain resolves to the EC2 instance's public IP address?
- A
A CNAME record pointing to the EC2 instance's private IP address
- B
An A record pointing to the EC2 instance's public IP address
- C
An MX record pointing to the EC2 instance's public IP address
- D
A TXT record containing the EC2 instance's public IP address
Show answer and explanation
Correct answer: B
Explanation
To make the domain example.com resolve to the EC2 instance, you need to create an A record in the Route 53 hosted zone. The A record maps the domain name to the public IP address of the EC2 instance, allowing users to access the website hosted on the instance. Other record types, such as CNAME, MX, or TXT, are not suitable for this scenario.
- A. Incorrect.
CNAME records are used to alias one domain name to another. However, they cannot point directly to an IP address, and the private IP address of the EC2 instance would not be accessible from the internet.
- B. Correct.
An A record maps a domain to an IP address and is the correct choice for directing traffic to an EC2 instance's public IP address.
- C. Incorrect.
MX records are used to specify mail servers for a domain, not to point to an EC2 instance for web traffic.
- D. Incorrect.
TXT records are used to store arbitrary text data, such as domain verification records, not to resolve a domain to an IP address.