본문 바로가기
Dev/Network

[Network] DNS - A, CNAME, ALIAS, URL

by 흰바다제비 2022. 8. 22.
728x90

A와 CNAME 레코드의 차이점

2022.08.21 - [Dev/Linux] - [Network] DNS - A, CNAME

 

[Network] DNS - A, CNAME

A와 CNAME 레코드의 차이점 A와 CNAME 레코드는 호스트명을 하나 이상의 IP 주소에 매핑하는 두 가지 일반적인 방법이다. 두 레코드 사이에는 중요한 차이점이 있다. 차이점 이해 A 레코드는 특정 IP

dev-kwon.tistory.com

 

A, CNAME, ALIAS 및 URL 레코드 간의 차이점

A, CNAME, ALIAS 및 URL레코드는 모두 호스트명이 사이트를 가리키도록 할 수 있는 솔루션이다. 차이점은 클라이언트가 사이트에 도달하는 방법에 있어 작은 차이점이 있다.

 

A, CNAME은 표준 DNS 레코드이고, ALIAS와 URL은 DNSimple의 DNS hosting에서 제공하는 커스텀 DNS 레코드이다.

ALIAS와 URL 둘 다 DNS 프로토콜과의 호환성을 보장하기 위해 내부적으로 A 레코드로 변환된다.

 

 

차이점

주요 차이점은 다음과 같다.

  • A 는 IP가 알려져 있고 안정적인 경우 하나 이상의 IP 주소에 매핑한다.
  • CNAME은 호스트명을 다른 호스트명으로 매핑한다. 해당 호스트명에 다른 레코드가 없는 경우에만 사용해야 한다.
  • ALIAS는 호스트명을 다른 호스트명으로 매핑하지만, 해당 호스트명의 다른 레코드와 공존할 수 있다.
  • URL은 HTTP 301 상태 코드를 사용하여 이름을 대상 호스트명으로 리다이렉션 한다.

중요한 규칙

  • A, CNAME, ALIAS 는 IP로 호스트명이 확인되어야 한다. 반대로 URL은 호스트명을 목적지로 리다이렉트한다. URL은 하나의 호스트명에 대한 리다이렉션을 다른 호스트명으로 적용하는 간단하고 효과적인 방법이다. (ex. www.example.com -> example.com)
  • A의 호스트명은 반드시 IP로 확인되어야 한다. CNAME과 ALIAS는 호스트명을 가리켜야 한다.

 

어느 것을 사용할 것인가?

일반적인 규칙

  • 특정 컴퓨터에 할당된 IP 주소를 관리하는 경우 또는 IP가 고정된 경우 A 레코드를 사용 (가장 일반적인 경우)
  • 하나의 호스트명을 다른 호스트명으로 지정하고, 동일한 호스트명에 대한 다른 레코드 (예: 이메일의 MX 레코드)가 필요하지 않은 경우 CNAME 레코드를 사용
  • 루트 도메인의 별칭을 지정하려고 하는 경우, 혹은 동일한 호스트명에 대한 다른 레코드가 필요한 경우 ALIAS 레코드를 사용
  • 호스트명을 목적지로 리다이렉트 하려면 URL을 사용

루트 도메인 이름(예: example.com)에 대해 CNAME 레코드를 사용해서는 안 된다.

 


원문

 

Differences Among A, CNAME, ALIAS, and URL records - DNSimple Help

Differences Among A, CNAME, ALIAS, and URL records A, CNAME, ALIAS, and URL records are all possible solutions to point a host name (“name”) to your site. However, they have small differences that affect how the client reaches your site. A and CNAME re

support.dnsimple.com

Differences Among A, CNAME, ALIAS, and URL records

A, CNAME, ALIAS, and URL records are all possible solutions to point a host name (“name”) to your site. However, they have small differences that affect how the client reaches your site.

A and CNAME records are standard DNS records. ALIAS and URL records are custom DNS records provided by DNSimple’s DNS hosting. Both of them are translated internally into A records to ensure compatibility with the DNS protocol.

Understanding the differences

These are the main differences:

  • The A record maps a name to one or more IP addresses when the IP are known and stable.
  • The CNAME record maps a name to another name. It should only be used when there are no other records on that name.
  • The ALIAS record maps a name to another name, but can coexist with other records on that name.
  • The URL record redirects the name to the target name using the HTTP 301 status code.

Important rules:

  • The A, CNAME, and ALIAS records cause a name to resolve to an IP. Conversely, the URL record redirects the name to a destination. The URL record is a simple and effective way to apply a redirect for one name to another name, for example redirecting www.example.com to example.com.
  • The A name must resolve to an IP. The CNAME and ALIAS records must point to a name.

Which one to use

Understanding the difference between A name and CNAME records will help you decide.

General rules:

  • Use an A record if you manage which IP addresses are assigned to a particular machine, or if the IP are fixed (this is the most common case).
  • Use a CNAME record if you want to alias one name to another name, and you don’t need other records (such as MX records for emails) for the same name.
  • Use an ALIAS record if you’re trying to alias the root domain (apex zone), or if you need other records for the same name.
  • Use the URL record if you want the name to redirect (change address) instead of resolving to a destination.

You should never use a CNAME record for your root domain name (e.g. example.com).

 

 

728x90

'Dev > Network' 카테고리의 다른 글

[Network] DNS  (0) 2022.08.27
[Network] Network commands - ping, traceroute, telnet  (0) 2022.08.26
[Network] TCP 3-way handshake  (0) 2022.08.24
[Network] DNS - A, CNAME  (0) 2022.08.21
[Network] Subnet  (0) 2022.08.14

댓글