CompTIA A+ Core 1 (220-1201)NetworkingHard
A company migrates its web server to a new hosting provider and receives a new IP address. The administrator wants users to keep using the friendly name 'www.company.com' and also wants 'shop.company.com' to point to the same location without maintaining two separate IP-mapped records. Which DNS record type should the administrator use for 'shop.company.com' to alias it to 'www.company.com'?
- APTR record
- BTXT record
- CA record
- DCNAME record
Show answer & explanationAnswer & explanation
Correct answer: D. CNAME record
A CNAME (Canonical Name) record creates an alias that points one domain name to another domain name, rather than to an IP address. This lets 'shop.company.com' automatically follow any future IP changes made to 'www.company.com' without needing separate updates.
Why the other options are wrong
- A. A PTR record performs reverse lookups from IP address to hostname.
- B. A TXT record stores arbitrary text data, often used for domain verification or SPF records.
- C. An A record maps a name directly to an IPv4 address, requiring updates if the IP changes.
CNAME Record
A DNS record type that maps an alias domain name to another canonical domain name instead of directly to an IP address.
- Simplifies maintenance when the underlying IP changes
- Cannot coexist with other record types for the same name
- Commonly used for subdomains like 'www' or 'shop'
Memory trick: CNAME chains a name to a name, not a number.