ADM-201 dump PMP dumps pdf SSCP exam materials CBAP exam sample questions

什么是DNS – 译学馆
未登陆,请登陆后再发表信息
最新评论 (0)
播放视频

什么是DNS

DNS: The Internet's Phonebook

当你接上因特网
When you’re connected to the internet
听音乐 玩线上游戏
and you are listening to music, playing online games
或浏览网页的时候
or browsing the web,
在这些场景的背后运行着许多标准协议
there are many standard protocols running behind the scenes,
来确保你的计算机能连接这些服务器
to make sure that your computer can indeed communicate with these services.
例如 因特网协议
There is for instance the Internet Protocol
或叫IP 负责从一台计算机向其它的计算机传送信息
or IP that is responsible for delivering messages from one computer to another.
这些信息也叫做包
These messages are also called packets
就像邮包
and just like postal packages
它们总是拥有发送者 接收者和有效负荷
They always havea sender, a receiver and a payload.
不过 不用街名和邮政编码
But instead of street names and postal codes,
因特网使用IP地址
the internet uses IP addresses and they look
看上去像是这样
something like this.
没有它们 计算机就不能彼此通信
Without them, computers can’t communicate with each other
也就意味着没有计算机网络
which means no computer networks
和没有因特网
and no internet.
那么 如果你打开油管
So if you open up YouTube,
你的计算机实际上向油管的IP地址发送了一条信息
your computer actually sends a message to YouTube’s IP address,
请求显示网页所需要的数据
asking for the data that it needs to show the webpage.
“但请稍等” 你说
“But wait a minute”, you say.
“当我想打开油管时 我只是在浏览器输入了YouTube.com
“ When I want to open YouTube I just enter youtube.com into my browser.
我不需要IP地址
I don’t need the IP address.
计算机是怎么知道地址的呢?”
So how does my computer know the address then?”
问得好
Well ! I’m Glad you asked!
在因特网的早期阶段(阿帕网)这个问题就被解决了
This issue was solved in the early days of the internet (ARPANET)
当时 斯坦福研究院创建了一个叫做“hosts.txt”的文档
when the Stanford Research Institute created a text file called “hosts.txt”.
该文件将youtube.com等名称翻译成
This file translated names like youtube.com,
计算机需要通信的IP地址
into the IP addresses that computers need to communicate.
然后 该文件被安装在所有连接到阿帕网的计算机上
The file was then installed on all the computers connected to the ARPANET
这样它们就可以将域名“翻译”成IP地址
so they could “ translate ” a domain name into an IP address.
然而 随着互联网的不断发展
However,as the internet kept growing,
计算机对这些域名的需求也在不断增长
so did the demand for these domain names.
管理主机文件的小团队很快就不堪重负了
The small team that was managing the hosts file was quickly overwhelmed
因此在1983年发布了一个规范来自动完成这项任务
and so in 1983 a specification was published to automate this task
于是DNS或“域名系统”便诞生了
and DNS or the “ Domain Name System ” was born.
DNS基本上是一个大型的互联网电话簿
DNS is basically a big phonebook for the internet,
将域名(如google.com)与IP地址相匹配
matching domain names like google.com to an IP address.
这个电话簿托管在分布于全球的DNS服务器上
This phonebook is hosted on DNS servers that are distributed across the world.
接下来让我们看一下
So let’s take a look at
当你想要访问www.google.com时会发生什么
what happens when you want to go to www.google.com.
首先 您的操作系统将域名分成多个部分
For starters your operating systems splits the domain name into multiple parts
或者也称为用点分隔的标签
or also called labels that are separated by dots.
在这种情况下 我们有三个标签:
So in this case we have three labels
“www” “google”和“com”
“ www ”, “ google ” and “ com ”.
他们创建了一个必须从右向左读取的层次结构
They create a hierarchy that has to be read from right to left.
最右边的标签叫做顶级域名
The right-most label is called the top-level domain,
在本例中是“com”
in this case “ com ”.
我们可以说“Google”是com的子域名
We can then say that “google” is a subdomain of “com”.
还可以说"www"是“Google”的子域名
and ” www” is a subdomain of”google".
要解析google.com的IP地址
To resolve the IP address of google.com,
您的计算机将访问根名称服务器
your computer reaches out to a root name server
然后问这个问题:“www.google.com”的IP地址是什么?
and asks the question: “What’s the IP address for “www.google.com”?
根名称服务器从不给出直接的答案
Root name servers never give a direct answer,
相反 它会给你推荐给更可能帮助你的服务器
instead they refer you to a server that is more likely to be able to help you.
在本例中 就是管着
In this case that’ll be the nameserver in charge
”.com”顶级域名的命名服务器
of the “ dot com ” top level domain.
你的计算机现在向“com”名称服务器询问同样的问题
Your computer now asks the same question to the “ com ” name server
而这个名称服务器可能会将您转到另一个名称服务器
and this one is likely to refer you to yet another name server.
这个例子中 它将再转到
In this case it will redirect you to
“google”托管的名称服务器上
a name server that Google itself hosts.
这个服务器很有可能
This one is very likely to be able
告诉计算机哪个IP地址连接到www.google.com
to tell what IP address is connected to www.google.com.
这种机制再加上域名的层次结构 使得DNS易扩展
This mechanism, along with the hierarchy of domain names makes DNS very scalable.
因为 毕竟
Because after all,
每个名称服务器只存储一小组IP地址
each name server only stores a small set of IP addresses.
” com “域名服务器对” org “上的网站一无所知
The “ com ” name servers don’t know anything about websites that are hosted on the “ org ” domain for instance.
就像电话簿一样
The phonebook analogy holds up here as well:
我的电话号码列在比利时的电话簿上
my phone number is listed in the Belgian phone book
但不在美国的电话簿上
but not in the US one.
但是 这样做有两个缺点
But there are however two drawbacks to this.
首先:
First of all:
这给根名称服务器带来了很大的压力
it puts a lot of pressure on the root name servers
因为每当有人想要连接到某个网站时 都会与它们联系
as they will be contacted every time someone wants to connect to a website
其次:设备需要能够链接到引用的来源
And secondly: devices need to be able to follow a referral,
来源从根服务器或其他名称服务器处获取
which it will get from root servers and perhaps other name servers as well.
这两个问题都被“递归解析器”解决了
Both these problems are solved by “recursive resolvers”.
这些是特殊的DNS服务器 将负责整个解析过程
These are special DNS servers that will take care of the entire resolving process.
你的设备不用再连接大量的名称服务器
Instead of having your devices contact multiple name servers,
只需要联系一个递归解析器就可以了
they just contact a recursive resolver which does it all for them.
它们通常由互联网服务提供商托管
They are often hosted by internet service providers
最近也由谷歌和Cloudflare等公司托管
and more recently are also hosted by companies like Google and Cloudflare.
大多数家用路由器都有双重功能 并且也可以作为递归解析器
Most home routers pull double duty and serve as a recursive resolver as well.
那么 我们的设备如何知道使用什么解析器呢?
So how do our devices know what resolver to use?
默认情况下 它们将使用由网络管理员配置的
Well by default they will use the one that is configured by the network administrator.
在您的ISP家庭网络中
In a home network that is your ISP
虽然它们可能会配置自己的解析器 但是您总是可以选择另一个解析器
and they’ll likely configure their own resolvers but you can always choose another one.
一些递归方式的解析器会比其他的解析器更快
Some recursive resolvers are faster than others,
所以切换到由谷歌或Cloudflare托管的解析器
so switching to a resolver hosted by Google or Cloudflare
可能会使你的连接的速度减缓
could give you a slight speed bump.
为了进一步加快DNS的速度
To speed up DNS even further,
递归解析器还有一个缓存
recursive resolvers also have a cache
它存储最频繁请求的域名的IP地址
which stores the IP address of domain names that are most frequently being requested.
当你在手机上访问Google.com时
When you go to google.com on your phone,
路由器上的递归解析器会查找谷歌的IP地址
the recursive resolver on your router will look up Google’s IP address
一旦找到了
and once it figures that out,
就把它存储在缓存中 以备将来参考
stores it in its cache for future reference.
如果你网络上的其他设备也想解析google.com
If another device on your network wants to resolve google.com as well,
你的路由器可以立刻给出一个答案
your router can instantly give an answer,
而不需要经历所有
without having to go through all the hoops
联系多个名称服务器的麻烦
of contacting multiple name servers.
虽然缓存可以大大提高
Caching can greatly increase the speed
DNS查询的速度 但也可能是有害的
of DNS queries but it can also be poisonous.
域名的IP地址的更改结果
Changes to the IP address of a domain name
不会立即在世界各地的域名上发生改变
aren’t immediately reflected across the world
因为旧地址仍然存储在
because the old address is still stored
许多递归解析器的缓存中
in the cache of many recursive resolvers.
为了解决这个问题
To combat this issue,
域所有者可以定义一个IP地址可以缓存多长时间
domain owners can define how long an IP address may be cached.
这称为TTL或生存时间 以秒为单位表示
This is called the TTL or time-to-live and is expressed in seconds.
如果缓存记录超出了给定TTL的时间
If a cache record is older than the given TTL,
解析器必须删除它
the resolver must delete it
然后必须再次使用传统的解析过程
after which it has to use the traditional resolving process again.
但是一些递归解析器不遵守这个TTL
But some recursive resolvers don’t adhere to this TTL
而是将记录保存在缓存中
and keep records in their cache
更长时间以减少负载
for a longer time to reduce the load.
上述做法是有问题的
This practice is problematic
因为网站所有者可能想要
for website owners wanting to change the IP addresses linked
改变链接到IP地址的域名
to their domain names.
但这只是个小问题
But that’s a minor hiccup.
很明显
It’s clear that
DNS是我们今天使用internet的主要基石
DNS is a major cornerstoneof the way we use the internet today.
它还有一些很酷的使用案例
It also has some cool alternative use cases.
例如 您可以使用自定义DNS服务器
You can for instance use a custom DNS server
来阻止广告或保护自己
to block advertisements or to protect yourself
免受传播恶意软件的域的攻击
from domains that spread malware.
听起来很复杂
Sounds complicated
但是你可以通过在树莓派上安装PiHole
but you can easily do it by installing PiHole on a Raspberry Pi
并将其插入到你的家庭网络中来轻松地做到这一点
and plugging it into your home network.
PiHole作为所有设备的递归DNS解析器
PiHole acts as a recursive DNS resolver for all your devices
当一个设备想解析ads.google.com时
and when a device wants to resolve ads.google.com for instance,
PiHole将返回一个本地IP地址
the PiHole will return a local IP address
并停止加载广告
and essentially stop the advertisement from loading.
真是天才的做法!
Genius!
以上是对域名系统的简要概述
So that’s a quick overview of the Domain Name System.
这是一个非常开放的系统
It’s a very open system
并且不可否认的是 它是一个使得网站对每个人来说都是可访问
and undeniably a protocol that makes the web accessible
以及易于使用的协议
and easy to use for everyone.
用容易记住的域名替换难记的IP地址
Replacing hard to remember IP addresses with easy to remember domain names.
这就是本期视频的全部内容
That was it for this video!
请在下面的评论中告诉我你的想法
Let me know what you thought about it in the comments below.
如果你喜欢这个视频
If you liked the video,
给它点赞 考虑订阅我的频道
give it a thumbs up and consider getting subscribed to my channel.
非常感谢您的收看 下次节目再见!
Thank you so much for watching and till next time!

发表评论

译制信息
视频概述

我们是怎样通过网络浏览网站的?DNS又是什么?它在我们上网过程中起什么作用呢?

听录译者

收集自网络

翻译译者

JK

审核员

审核员BZ

视频来源

https://www.youtube.com/watch?v=FJYa6C-MXno

相关推荐