AWS · Advanced Networking Specialty

网络课程笔记

Lecture 200 · 7 张幻灯片

幻灯片、双语总结及 Transcript · 图片已内嵌,可离线阅读。

原文默认收起
lecture-200.md

Lecture 200: Route 53 CNAME vs Alias

  • 课程:[NEW] AWS Certified Advanced Networking Specialty 2026
  • 视频时长:07:00
  • 来源:Udemy Lecture 28556395
  • Slide 数量:7
  • 画面切换:01:21、02:15、03:02、04:19、05:28、06:14

扫描说明

逐条读取了 Udemy 页面中的 169 条英文 Transcript cue,并按时间轴扫描全长约 07:00 的视频。依据 CNAME/Alias 核心差异、Alias 行为、支持 Target、CNAME 子域 Hands-on、Alias 子域 Hands-on、Apex CNAME 失败、Apex Alias 成功划分为 7 个小节。截图均在 Transcript 侧栏关闭、播放器控件隐藏后复核,统一为 1364×770。

Transcript 来自 Udemy 页面自带的英文自动字幕,没有使用 ASR。下面保留页面原文,包括其中的语法或识别错误。

1. CNAME 只支持非根域,Alias 支持根域且免查询费

时间范围:00:00–01:21

CNAME versus alias records for AWS resource hostnames

总结 / Summary

中文

AWS Resource(如 ALB、CloudFront)暴露 AWS Hostname,常需映射到自有 Domain。CNAME 可把任意 Hostname 指向另一个 Hostname,但只能用于 app.mydomain.com 等 Non-root Name,不能用于 mydomain.com。Route 53 Alias 专门指向支持的 AWS Resource,可用于 Root/Zone Apex 与 Subdomain,查询免费且支持 Native Health Check。

English

AWS resources such as ALB and CloudFront expose AWS hostnames that often need mapping to a custom domain. A CNAME points any hostname to another hostname but works only for non-root names such as app.mydomain.com, not mydomain.com. A Route 53 alias points to supported AWS resources, works at both the zone apex and subdomains, is free to query, and supports native health checks.

Transcript

00:00 So now let's have a look at the differences

00:02 between CNAME and Aliases.

00:04 So when you have an AWS Resource,

00:06 for example, a Load Balancer or CloudFront,

00:08 it will expose a hostname.

00:09 And what you want is to maybe map that hostname

00:12 to a domain you own.

00:13 For example, you want to map this Load Balancer

00:15 into myapp.mydomain.com.

00:17 So we have two options.

00:19 The first one is to use a CNAME record.

00:20 So we've seen A records,

00:21 but now let's look at CNAME records.

00:23 So CNAME allows you to point a hostname

00:26 to any other hostname.

00:27 For example, you can say app.mydomain.com

00:30 is pointing to blabla.anything.com.

00:32 And this only works if you have a non root domain name,

00:36 so if you have something.mydomain.com.

00:38 It does not work for just mydomain.com,

00:40 as we'll see in the hands-on.

00:42 On the other hand, you have alias records,

00:44 and these are specific to Route 53,

00:47 but they allow you to point a hostname

00:49 to a specific AWS Resource.

00:51 So app.mydomain.com is pointing to blabla.amazonaws.com.

00:56 And these resources we'll see in a second where they are.

00:59 But these alias records work

01:00 for both root domains and non root domains.

01:03 So you can have mydomain.com pointing

01:06 to, as an alias, to an alias resource

01:09 which is very, very good.

01:10 So this is something that the exam may test you on,

01:13 and we'll see this in the hands-on.

01:14 So on top of it, alias is very good

01:15 because they're free of charge,

01:17 and they have a native health check capability within them.

2. Alias 是 A/AAAA Record,自动跟踪 Resource IP 且无自定义 TTL

时间范围:01:21–02:15

Route 53 alias A record automatically following an ALB DNS name and IP changes

总结 / Summary

中文

Alias 是 Route 53 对 DNS 的扩展:Record Type 仍是 A 或 AAAA,但 Value 选择 AWS Resource 的 DNS Name。Route 53 会跟踪 ALB 等 Target 的 IP Change,并允许 Zone Apex 使用。Alias 不能手工设置 TTL,TTL 由 Route 53/Target 自动决定。

English

An alias is a Route 53 extension to DNS. Its record type remains A or AAAA, while its value selects an AWS resource DNS name. Route 53 tracks target IP changes such as those of an ALB and allows the record at the zone apex. An alias has no user-configured TTL; Route 53 and the target determine it automatically.

Transcript

01:21 Okay, so if we look at these alias records in details,

01:23 they are only mapped to resources in AWS.

01:26 So you would say, "Okay, here is Route 53.

01:28 I want to have example.com as an alias record of type A,

01:32 and the value is the DNS name of the load balancer you have.

01:37 Now, this is an extension to DNS functionalities.

01:40 That's something that's across all DNS

01:41 that exist out there.

01:42 And in case the underlying ALB have IP changes,

01:46 then automatically the alias record will recognize them.

01:49 So it said unlike CNAME, alias records can be used for top,

01:54 for the top node of the DNS namespace called the Zone Apex,

01:57 so you can use a alias record for example.com.

02:00 Now, the alias record is always of type A or AAAA

02:05 which is for resources, so either IPv4 or IPv6.

02:10 When you have an alias record, you cannot set the TTL.

02:12 It is set automatically by Route 53.

3. 支持 ELB、CloudFront、API Gateway、S3 Website 等 Target

时间范围:02:15–03:02

Supported Route 53 alias targets across AWS services

总结 / Summary

中文

Alias Target 包括 ELB、CloudFront Distribution、API Gateway、Elastic Beanstalk Environment、S3 Website Endpoint(不是普通 S3 Bucket)、VPC Interface Endpoint、Global Accelerator,以及同一 Hosted Zone 内的 Route 53 Record。EC2 DNS Name 不能作为 Alias Target,这是常见考试陷阱。

English

Alias targets include ELB, CloudFront distributions, API Gateway, Elastic Beanstalk environments, S3 website endpoints (not ordinary S3 buckets), VPC interface endpoints, Global Accelerator, and Route 53 records in the same hosted zone. An EC2 DNS name cannot be an alias target, a common exam trap.

Transcript

02:15 So what are the targets for alias records?

02:18 Well, it could be Elastic Load Balancers.

02:20 It could be CloudFront Distributions.

02:22 And some of these you'll see,

02:23 you'll have seen in this course,

02:24 some of these you will not have seen in this course,

02:26 but this is fine.

02:27 It's just for you to get an idea of what they can be.

02:29 So ELBs, CloudFront Distributions, API Gateway,

02:33 Elastic Beanstalk environments, S3 Websites,

02:36 so not S3 Buckets but S3 Websites

02:37 when these buckets are enabled as websites,

02:40 VPC Interface Endpoints, Global Accelerator accelerator,

02:44 and Route 53 records in the same hosted zone.

02:47 One thing that is not there

02:49 is that you cannot set an alias for an EC2 DNS name.

02:52 This is something you need to remember.

02:53 So EC2 DNS names are not something you can have a target,

02:57 that can be the target of an alias record, okay?

03:00 Just, and also to let you to know.

4. 用 CNAME 把 myapp 子域映射到 ALB DNS

时间范围:03:02–04:19

CNAME subdomain resolving to the ALB and returning its Frankfurt target page

总结 / Summary

中文

创建 myapp.stephanetheteacher.com,Type 选 CNAME,Value 粘贴 Frankfurt ALB DNS Name。浏览器访问 myapp… 后,由 CNAME 解析到 ALB,再转发至 Target Group 的 EC2,页面返回 eu-central-1c。该方式遵循标准 DNS、适用于非根域,但不具备 Alias 的 AWS 原生免查询费与 Target Health 集成。

English

Create myapp.stephanetheteacher.com as a CNAME whose value is the Frankfurt ALB DNS name. Browsing to myapp resolves through the CNAME to the ALB, which forwards to its target group and returns eu-central-1c. This standards-based DNS approach works for non-root names but lacks alias-specific free queries and target-health integration.

Transcript

03:02 So now let's have a look in the console

03:03 to see how CNAMEs and alias records work.

03:06 So let's go ahead and create a record,

03:08 and this one will be of type CNAME.

03:11 So I will call this one myapp.stephanetheteacher.com.

03:15 And the record type now is not A, it's not AAAA. It's CNAME.

03:19 And then the value must be a domain name.

03:22 And very easy, I already have a domain name available.

03:24 That's my ALB.

03:26 So what I'm going to do

03:26 is I'm going to copy those name of my ALB

03:29 and paste it in here.

03:31 The idea is that now

03:31 instead of accessing my ALB through this URL,

03:34 I want to be access the ALB

03:36 through myapp.stephanetheteacher.com.

03:38 Okay, so I will just create this record,

03:43 and now myapp.stephanetheteacher.com has been created.

03:47 And so if I go into my Chrome web browser

03:50 on the right-hand side and open this URL,

03:56 now you see that the answer is Hello World

03:58 from my IP blah, blah, blah in AZ eu-central-1c.

04:02 So this domain name is in fact covered by the ALB,

04:07 and the ALB is directing the traffic into one EC2 instance,

04:10 and so therefore I receive back this Hello World.

04:13 So this is good, but this is not AWS native, okay?

04:16 This is something that will work for many domain names,

04:18 but we can do something better.

5. 用 A Alias 选择 Region、ALB 与 Evaluate Target Health

时间范围:04:19–05:28

Route 53 A alias selecting a Frankfurt ALB and enabling target-health evaluation

总结 / Summary

中文

创建 myalias 子域,Record Type 选 A,开启 Alias,Target 选 Application and Classic Load Balancer,指定 eu-central-1 与具体 ALB,并把 Evaluate Target Health 设为 Yes。创建后 Query 免费,浏览器得到与 CNAME 相同的 Frankfurt 页面,但 Route 53 原生理解 Target Resource 与健康状态。

English

Create the myalias subdomain with record type A and alias enabled. Choose Application and Classic Load Balancer, select eu-central-1 and the specific ALB, and set Evaluate Target Health to Yes. Queries are free and the browser returns the same Frankfurt page as the CNAME, while Route 53 natively understands the target resource and health.

Transcript

04:19 Because we are redirecting into an ALB,

04:22 what we can do is create an alias record.

04:24 So I can create a record,

04:26 and this time it's going to be

04:27 myalias.stephanetheteacher.com,

04:30 and the record type is A

04:31 because my ALB is currently having only IPv4 traffic.

04:36 And the value of it,

04:37 so we have to say, we have to take the alias right here,

04:40 and we're going to route traffic to,

04:42 and then we have a list of options, okay?

04:45 So we can see a lot of different options,

04:47 but right now it's going to be

04:48 an Alias to an Application and Classic Load Balancer.

04:51 We need to choose a region, so it is in eu-central-1 for me.

04:55 And then we need to choose the load balancer,

04:57 so I will choose this load balancer right here.

04:59 Then automatically we can evaluate

05:01 the target health as well with a Yes

05:03 because this is an alias record.

05:05 So we'll click on Create this record,

05:08 and now I have a new record right here

05:10 called myalias.stephanetheteacher.com.

05:12 And the cool thing is that this record

05:14 is free to query, okay?

05:15 So I'm not going to pay any money

05:16 because this is an alias record.

05:18 So if I click on myalias.stephanetheteacher.com,

05:20 it's going to perform a few DNS queries,

05:22 and now, again, I get the same response.

05:24 Okay, nothing has changed, but it is working.

05:26 Okay, so that's perfect.

6. Zone Apex 创建 CNAME 会收到 not permitted 错误

时间范围:05:28–06:14

Route 53 rejecting a CNAME at the hosted-zone apex

总结 / Summary

中文

Record Name 留空表示 stephanetheteacher.com Zone Apex。尝试把 Apex 设置为指向 ALB DNS 的 CNAME,Route 53 返回 InvalidChangeBatch:CNAME is not permitted at apex of this zone。原因是 Apex 同时必须存在 NS/SOA,DNS 规范禁止 CNAME 与其他 Record 共存。

English

Leaving the record name blank targets the stephanetheteacher.com zone apex. Attempting a CNAME from the apex to the ALB DNS name returns InvalidChangeBatch: CNAME is not permitted at apex of this zone. The apex must also contain NS and SOA records, and DNS forbids a CNAME from coexisting with other records at the same name.

Transcript

05:28 But now what if you consider the domain apex,

05:31 so if you want to have just stephanetheteacher.com

05:33 to redirect to this page?

05:36 So what we're going to do is create a record,

05:39 and let's go ahead.

05:40 So we're going to just have nothing in here, okay?

05:43 And we're going to have a CNAME record

05:44 pointing to the domain name of my ALB

05:48 which is copied from here and pasted in here.

05:52 Okay, so we want to say, "Hey, stephanetheteacher.com

05:54 is going to be a CNAME for this value."

05:57 Now, this is not going to work. Let's try it.

06:00 It's saying, "Hey, bad request.

06:02 The CNAME is not permitted at apex of this zone."

06:06 So this zone is stephanetheteacher.com,

06:08 and the apex of the zone is stephanetheteacher.com,

06:11 and therefore we cannot set up a CNAME at the apex.

7. Zone Apex 用 A Alias 可成功指向 ALB

时间范围:06:14–07:00

Successful Route 53 A alias at the zone apex pointing to an ALB

总结 / Summary

中文

解决办法是创建 Record Name 为空、Type A、Alias Enabled 的记录,并选择 eu-central-1 ALB。Route 53 接受该 Apex Alias,浏览器直接访问 stephanetheteacher.com 即返回 Load Balancer 的 Hello World。考试遇到“根域指向 AWS Resource”应优先选择 Alias,而不是 CNAME。

English

The solution is a blank-name, type-A record with alias enabled, targeting the eu-central-1 ALB. Route 53 accepts the apex alias, and browsing directly to stephanetheteacher.com returns the load balancer page. On the exam, when a root domain must point to an AWS resource, choose an alias rather than a CNAME.

Transcript

06:14 So the only way we can deal with this issue

06:17 is instead to create an alias

06:19 and the record is going to be of type A,

06:22 and the alias is going to point again to an ALB or CLB

06:26 in the eu-central-1 region,

06:28 and the load balancer is going to be the one from before.

06:31 Now, this is going to be accepted

06:32 because this is an alias record,

06:33 and this is what the exam may test you on, okay?

06:36 And so now we can see

06:37 that stephanetheteacher.com is accessible.

06:40 And so if I go back into my web browser in here,

06:42 open a new tab and enter stephanetheteacher.com

06:45 and press Enter,

06:48 here I get back the Hello World from my load balancer,

06:52 so everything is working great, so that's it.

06:54 We've shown how CNAMEs and alias records work in AWS.

06:57 I hope you liked it, and I will see you in the next lecture.

整讲总结 / Overall Summary

中文

CNAME 是标准 DNS Hostname-to-Hostname 映射,只能用于非根域;Route 53 Alias 是 A/AAAA 扩展,支持 Zone Apex、自动跟踪 AWS Resource IP、查询免费并可 Evaluate Target Health,且 TTL 自动管理。Alias 支持多种 AWS 服务,但不能直接指向 EC2 DNS Name。

English

CNAME is a standard hostname-to-hostname mapping usable only for non-root names. A Route 53 alias is an A/AAAA extension that supports the zone apex, follows AWS resource IP changes, offers free queries and optional target-health evaluation, and manages TTL automatically. Many AWS services are supported, but an EC2 DNS name is not a valid alias target.

返回顶部 ↑