当前位置: 首页 > 编程日记 > 正文

域名管理系统 二级域名_域名系统简介

域名管理系统 二级域名

by Sumedh Nimkarde

由Sumedh Nimkarde

域名系统简介 (An introduction to the Domain Name System)

You all might have heard about or know about the Domain Name System (DNS) if you understand how the internet works or how computer networks work. If you aren’t familiar with DNS, I would recommend that you go and check out my previous blog post which is focused on computer networks here.

如果您了解互联网的工作方式或计算机网络的工作方式,那么您可能都听说过或知道域名系统(DNS)。 如果你不熟悉DNS,我建议你去看看它是专注于计算机网络我以前的博客文章在这里 。

Hostnames alone cannot tell us where the particular machine/hardware that we are trying to communicate with is located in the world. Hence, all communication is done with IP addresses.

仅主机名不能告诉我们我们试图与之通信的特定机器/硬件在世界上的何处。 因此,所有通信都是通过IP地址完成的。

Domain Name Servers are the devices that map the hostname to the IP addresses of the machine/hardware on which your services are running.

域名服务器是将主机名映射到运行您的服务的计算机/硬件的IP地址的设备。

In this post, I will be explaining in detail the types of DNS queries, types of DNS servers, and types of DNS records.

在这篇文章中,我将详细解释DNS查询的类型,DNS服务器的类型和DNS记录的类型。

DNS解析器 (DNS Resolver)

DNS Resolvers are the computers used by Internet Service Providers (ISPs) to perform lookups in their database for the particular hostname requested by the user. They then redirect that user to the mapped IP address. They play a vital role in DNS Resolution.

DNS解析器是Internet服务提供商(ISP)用来在其数据库中针对用户请求的特定主机名执行查找的计算机。 然后,他们将该用户重定向到映射的IP地址。 它们在DNS解析中起着至关重要的作用。

DNS Resolvers also cache the data. So for example, my websiteexample.com is currently hosted on a machine with the IP address 35.195.226.230 . So, the caches of the DNS Resolvers all over the world have mapped the following:

DNS解析器还会缓存数据。 因此,例如,我的网站example.com当前托管在IP地址为35.195.226.230 。 因此,全球DNS解析器的缓存已映射以下内容:

example.com -> 35.195.226.230

example.com &g t; 35.195.226. t; 35.195.226. 230

Consider, in the future, if I want to host my website on any another server across the world with an IP of, say, 35.192.247.235. The DNS caches of all the DNS Resolvers across the world will still have the old IP address for some time. This may lead to unavailability through conventional means of the website until the DNS propagation happens completely.

考虑一下,如果将来我想将我的网站托管在IP为35.192.247.235的全球任何其他服务器上。 全球所有DNS解析器的DNS缓存在一段时间内仍将具有旧IP地址。 这可能会导致通过网站的常规方式无法使用,直到DNS传播完全发生为止。

The record in the DNS Resolver cache remains there for some time, which is called time to live (TTL for short).

DNS解析器缓存中的记录会保留一段时间,这称为生存时间(简称TTL)。

This is the time a record is cached in the DNS Resolver. This can be set in the registrar’s dashboard from where you have purchased the domain.

这是一条记录在DNS解析器中缓存的时间。 可以在您购买域名的注册商控制台中进行设置。

Note: from now on, I will refer to the DNS Resolver as Resolver only in this blog post.

注意:从现在开始,我仅在此博客文章中将DNS解析器称为解析器。

DNS服务器类型 (Types of DNS servers)

根DNS服务器 (Root DNS server)

The Root DNS servers are the ones who have the addresses of all the TLD domain servers. A request first encounters the Root DNS servers while on its journey to obtain the IP address from the hostname.

根DNS服务器是具有所有TLD域服务器地址的服务器。 在从主机名获取IP地址的过程中,请求首先遇到根DNS服务器。

There are 13 root domain name servers across the world as of 2016. This does not mean that there are only 13 machines handling the load of the requests coming from all over the world — there are multiple servers at ground level handling the load.

截至2016年,全球共有13台根域名服务器。这并不意味着只有13台计算机可以处理来自世界各地的请求负载-地面上有多台服务器可以处理负载。

Different organizations manage the Root DNS servers:

不同的组织管理根DNS服务器:

TLD域服务器 (TLD domain server)

These are the ones classified according to the Top-Level Domain. They are usually the next ones which the iterative query hits after the Root DNS server. They store the TLD specific records for the hostname.

这些是根据顶级域分类的。 它们通常是根DNS服务器之后迭代查询命中的下一个查询。 它们存储主机名的TLD特定记录。

Let’s say if we are requesting an IP address of medium.com , then the TLD domain servers for “.com” TLD are queried. The TLD domain servers return the address of the Authoritative DNS servers to the Resolver.

假设如果我们请求IP地址为medium.com ,那么将查询“ .com” TLD的TLD域服务器。 TLD域服务器将权威DNS服务器的地址返回到解析器。

Now, the question arises: how does the TLD name server know the address of the Authoritative Name server? The answer is simple: when you purchase any domain with the registrars like Godaddy or Namecheap, the registrars also communicate the domains to the TLD name server. So it is able to contact the Authoritative Name servers.

现在,出现了一个问题:TLD名称服务器如何知道权威名称服务器的地址? 答案很简单:当您通过Godaddy或Namecheap之类的注册商购买任何域名时,注册商还将这些域名传达给TLD名称服务器。 因此,它可以联系权威名称服务器。

Nowadays, some of the registrars provide the ability to use third party Authoritative Name servers. As shown in the above figure, you can set up the Authoritative Nameservers in the registrar’s dashboard.

如今,某些注册商可以使用第三方权威名称服务器。 如上图所示,您可以在注册商的仪表板中设置权威名称服务器。

权威DNS服务器 (Authoritative DNS server)

These are queried iteratively in the end by the Resolver. They store the actual records for type A, NS, CNAME, TXT, etc.

最后,解析程序会反复查询这些内容。 它们存储类型A,NS,CNAME,TXT等的实际记录。

Thus, they return the IP address of the hostname if available. If it is not available even in the Authoritative DNS server, then they throw an error with the particular message and the process of searching IP addresses across the Nameserver ends.

因此,它们将返回主机名的IP地址(如果可用)。 如果即使在权威DNS服务器中也不可用,则他们会向特定消息抛出错误,并且跨名称服务器搜索IP地址的过程结束。

DNS查询类型 (Types of DNS queries)

There are three types of DNS queries:

DNS查询分为三种:

Recursive: Recursive queries are made by users to the Resolver. It is actually the first query made while doing any DNS lookup.

递归 :用户对解析器进行递归查询。 它实际上是在进行任何DNS查找时进行的第一个查询。

The Resolvers can be your ISP or your network admin, but usually, it is the ISP in almost all cases.

解析程序可以是您的ISP或您的网络管理员,但是通常,在几乎所有情况下,它都是ISP。

Non-recursive: in non-recursive queries, the Resolver knows the answer and responds immediately without making any further queries to any other name servers. This happens because the local DNS server has the IP address stored in its local cache or it just queries the Authoritative name servers directly. They happen to definitely hold the record and this eventually avoids the recursive queries.

非递归:在非递归查询中,解析程序知道答案并立即响应,而无需对任何其他名称服务器进行任何进一步查询。 发生这种情况是因为本地DNS服务器在其本地缓存中存储了IP地址,或者仅直接查询了权威名称服务器。 它们恰好保持记录,这最终避免了递归查询。

Iterative: Iterative queries happen when the Resolver cannot return the results since they may not have cached it. So, it makes a request to the Root DNS server. And the Root DNS servers know where to find the particular TLD domain server.

迭代 :迭代查询发生在解析器无法返回结果(因为它们可能没有缓存结果)时。 因此,它向根DNS服务器发出请求。 根DNS服务器知道在哪里可以找到特定的TLD域服务器。

So, for example, if we are trying to obtain the IP address for say medium.com , then the Root domain server will have the address of the .com TLD server stored in it and will then send it back to the Resolver. The Resolver then asks the TLD server for the IP address. The TLD domain server may not know it, but it knows the address of the Authoritative DNS server for medium.com .

因此,例如,如果我们尝试获取medium.com的IP地址,则根域服务器将在其中存储.com TLD服务器的地址,然后将其发送回解析器。 然后,解析程序会向TLD服务器询问IP地址。 TLD域服务器可能不知道,但它知道medium.com的权威DNS服务器的medium.com

Okay, enough of the theory. Let’s understand it by a flow diagram:

好的,理论足够了。 让我们通过流程图来了解它:

Let’s break down the above diagram in steps:

让我们按步骤分解上图:

  1. The user makes a request to the Resolver with the hostname for which it wants the IP address. This is a recursive query.

    用户使用需要其IP地址的主机名向解析器发出请求。 这是一个递归查询。
  2. The Resolver does a lookup in its cache to see if it is present in it.

    解析程序在其缓存中进行查找以查看其是否存在。
  3. If it is, it returns it back to the user.

    如果是,则将其返回给用户。
  4. If it does not have it cached, it makes an iterative request to the Root DNS servers that are present globally. As of 2016, there are 13 Root DNS servers named from A — M. Now, the Root DNS server looks up for the TLD of the requested domain. For example, if the hostname is medium.com , then the TLD becomes “.com” and the Root DNS server has the entry for “.com” domain servers and it returns the results back to the Resolver. The Resolver must have the addresses of all the Root domain name servers. If it doesn’t, the DNS lookup may fail in the first place.

    如果没有缓存它,它将向全局存在的Root DNS服务器发出迭代请求。 截至2016年,有13个以A — M命名的Root DNS服务器。现在,Root DNS服务器将查找所请求域的TLD。 例如,如果主机名是medium.com ,则TLD变为“ .com”,并且根DNS服务器具有“ .com”域服务器的条目,并将结果返回给解析器。 解析程序必须具有所有根域名服务器的地址。 如果不是这样,DNS查找可能首先会失败。

  5. Now, the Resolver again makes an iterative request to the TLD domain server asking for the IP address of the domain. The TLD domain server then returns back the address of the Authoritative server for the requested domain.

    现在,解析器再次向TLD域服务器发出迭代请求,要求该域的IP地址。 然后,TLD域服务器将返回所请求域的权威服务器的地址。
  6. As of now, I believe, you may understand what are Authoritative DNS servers. They contain the actual records where the hostname is mapped to the IP address and hence the IP address is returned back to the Resolver (which in turn returns it back to the user).

    我相信,到目前为止,您可能已经了解什么是权威DNS服务器。 它们包含实际记录,在这些记录中,主机名已映射到IP地址,因此IP地址被返回给解析器(解析器又将其返回给用户)。
  7. If no matching record is found in the Authoritative Name servers, then an error with a message saying “DNS_PROBE_FINISHED_NXDOMAIN” is thrown indicating there is no record for the requested hostname.

    如果在“权威名称”服务器中找不到匹配的记录,则会引发一条错误消息,提示“ DNS_PROBE_FINISHED_NXDOMAIN”,表明没有所请求主机名的记录。
  8. In all the Nameservers the request passes through, the results for the requested hostname are cached so that when any other user requests the same domain, the record will already be present in the DNS cache.

    在请求经过的所有名称服务器中,将缓存所请求主机名的结果,以便当任何其他用户请求同一域时,该记录将已经存在于DNS缓存中。
  9. All in all, it takes at the max four queries to perform the DNS lookup. But, it hardly takes a few milliseconds to perform the lookup.

    总而言之,最多需要四个查询来执行DNS查找。 但是,几乎不需要花费几毫秒的时间来执行查找。

DNS传播的概念 (The concept of DNS Propagation)

Consider, you have your website hosted with some provider like Digital Ocean on any machine with IP “x”, and you want to shift the website hosting to any other machine with different IP address say “y”. You will have to change the IP address in the Authoritative records so that traffic navigates to the new IP address.

考虑一下,您的网站托管在数字IP为“ x”的任何计算机上,由Digital Ocean等提供商托管,并且您希望将网站托管转移到其他IP地址为“ y”的计算机。 您将必须在权威记录中更改IP地址,以便流量导航到新的IP地址。

Even if you update the records in your registrar’s/ name server’s dashboard, it takes some time to reflect in all the Resolvers’ caches in the world. DNS propagation can take 24–72 hours, but usually it happens sooner than that since most ISPs keep the TTL low.

即使您更新了注册服务商/名称服务器的仪表板中的记录,也需要花费一些时间来反映世界上所有解析程序的缓存。 DNS传播可能需要24到72个小时,但通常会比大多数情况更早发生,因为大多数ISP将TTL保持在较低水平。

And that’s it!

就是这样!

Thanks for reading the article. If you have any questions, please feel free to ask them in the comments below and share this post with whomever you want.

感谢您阅读本文。 如果您有任何疑问,请随时在下面的评论中提问,并与任何人分享。

See you in the next one. Have a great time. Thank you.

下一个见。 玩得开心。 谢谢。

You can check out my other article on Computer Networks which explains them in detail:

您可以查看我在《计算机网络》上的另一篇文章,其中详细介绍了它们:

What computer networks are and how to actually understand themWhether you are new to the world of development, or have been building things for a long time — or even if you’re a…medium.freecodecamp.org

什么是计算机网络以及如何真正理解它们? 无论您是开发世界的新手,还是已经构建了很长时间的计算机-甚至您是一个中等水平的人。

If you like my work, you can buy me a coffee at:

如果您喜欢我的工作,可以在以下位置给我买咖啡:

Buy Sumedh Nimkarde a Coffee - BuyMeACoffee.comHello, I am Sumedh and my work is to build, break and rebuild things.buymeacoffee.com

买Sumedh Nimkarde喝咖啡-BuyMeACoffee.com 您好,我是Sumedh,我的工作是建造,破坏和重建事物。 buymeacoffee.com

Feel free to reach out to me on Twitter.

随时通过Twitter与我联系。

翻译自: https://www.freecodecamp.org/news/understanding-the-domain-name-servers-46c6bcf9afa3/

域名管理系统 二级域名

相关文章:

redis面试总结

(1)什么是redis? Redis 是一个基于内存的高性能key-value数据库。 (2)Reids的特点 Redis本质上是一个Key-Value类型的内存数据库,很像memcached,整个数据库统统加载在内存当中进行操作,定期通…

struts2 实现自定义标签

/*** lostingz* Created on 2015年11月18日*/ package com.test.web.tags;import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse;import org.apache.struts2.components.Component; import org.apache.struts2.views.jsp.ComponentTa…

php修改多个字段

1.直接修改 2.按条件修改 1.代码&#xff1a; <?phpheader("Content-Type:text/html;charsetutf8"); header("Access-Control-Allow-Origin: *"); //解决跨域header(Access-Control-Allow-Methods:GET);// 响应类型 header(Access-Control-Allow-H…

备忘录吕吕没有备忘录十新建_一份备忘单,可帮助您记住CSS自定义属性

备忘录吕吕没有备忘录十新建CSS custom properties, also known as CSS variables, represent custom properties that can be declared and be called in your CSS.CSS定制属性&#xff0c;也称为CSS变量&#xff0c;表示可以在CSS中声明和调用的定制属性。 在CSS中声明自定义…

Oracle数据库一些操作信息

Oracle数据库如何查看当前用户角色权限及默认表空间查看当前用户的一些信息&#xff0c;包括用户拥有的角色权限信息、用户表空间以及用户和默认表空间的关系等--查看用户的角色权限1、查看当前用户拥有的角色权限信息&#xff1a;select * from role_sys_privs; 2、查看所有用…

Eclipse用法和技巧十:显示代码outline

在一个文件中快速找到某一个方法或者某一个作用域&#xff0c;可以使用 CtrlO或者CtrlF3&#xff0c;快速显示当前代码的outline&#xff0c;进行快速查找。效果如下&#xff1a; 这里主要是补充一些后续操作&#xff0c;能更加方便的帮助我们查找。 步骤一&#xff1a;再…

上传文件到服务器指定目录,文件名相同自动替换PHP实现代码

效果图&#xff1a; html代码&#xff1a; <!DOCTYPE html> <html> <head> <meta charset"utf-8"> <title>菜鸟教程(runoob.com)</title> </head> <body><form action"https://xxx.wang/xxx/upload.php&qu…

ssh框架实现数据库_自顶向下介绍SSH及其如何实现安全的数据共享

ssh框架实现数据库by Sam Ollason通过萨姆奥拉森(Sam Ollason) This article will take a high-level and top-down approach to explain how SSH works and how it is used for securely communicating with remote computers.本文将采用一种自上而下的高级方法来解释SSH的工…

UITableView

表格视图 目录 表格视图的功能和介绍表格视图的基本使用显示分组数据单元格的构成和基本定制常用事件处理添加头部视图和尾部视图设置段头和段尾表格视图的编辑(难点)表格视图的索引表格的分割线表格视图的搜索表格视图控制器表格视图的功能和介绍 表格视图的功能:如上图所示,t…

js 跨页面的全局变量

定义全局变量的js&#xff1a; a.js 1 function GlobalConfig(){ 2 3 } 4 GlobalConfig.IPSSAddress"http://localhost/index/"; 5 (function(){ 6 7 })(); View Code页面index.html里需要引用a.js 页面index.html自己的js&#xff1a; b.js $scope.URL GlobalCon…

微信小程序发送表情

实现代码&#xff1a; 先在data定义两个数组&#xff0c;分别是表情和存表情正则替换的符号表示 connectemoji: [&#x1f60a;, &#x1f605;, &#x1f632;, &#x1f62d;, &#x1f602;, &#x1f604;, &#x1f629;, &#x1f61e;, &#x1f635;, &#x1f612;, …

CSS-in-JS的权衡

by Oleg Isonen由Oleg Isonen CSS-in-JS的权衡 (The tradeoffs of CSS-in-JS) Recently I wrote a higher level overview of CSS-in-JS, mostly talking about the problems this approach is trying to solve. Library authors rarely invest time into describing the trad…

抽象工厂模式AbstractFactory

简介 抽象工厂模式(Abstract Factory Pattern)&#xff1a;提供一个创建一系列相关或相互依赖对象的接口&#xff0c;而无须指定它们具体的类。抽象工厂模式又称为Kit模式&#xff0c;属于对象创建型模式。 不同点 为了更清晰地理解抽象工厂模式&#xff0c;需要先引入两个概念…

uni-app 之 使用扩展组件(uni ui) Pagination 分页器使用示例

先贴出 分页器文档的地址&#xff1a; Pagination 分页器 使用步骤&#xff1a; 1.下载或者导入插件到你的项目&#xff1b; 2.在需要使用的页面引入该插件。 使用操作&#xff1a; 1.下载或者导入插件到你的项目&#xff1b; 导入的操作流程示例图&#xff1a; 点击使用…

S3C2440-中断体系架构

1.ARM的体系与架构 1.1.ARM体系的CPU有以下其中工作模式: 用户模式 (usr)快速中断模式 (fiq) 中断模式 (irq)管理模式 (svc)数据访问终止模式 (abt)系统模式 (sys)未定义指令终止模式 (und)1.2.ARM寄存器: 31个通用寄存器 : R0~R7(未备份寄存器) , R8~R14(备份寄存器) , R15( …

编码和编码格式一样吗?_学习如何像专业人士一样编码

编码和编码格式一样吗?Learn how to write more professional code from Dylan Israel. Dylan teaches about tools and principles to improve your code that hes found helpful in his job as a developer.从Dylan Israel了解如何编写更专业的代码。 Dylan教授有关改善您的…

__bridge 使用注意

前奏 在平常开发中,我们可能遇到 CoreFoundation(CF) 框架的对象和 OC 对象之间的类型转换,这时候我们需要 __bridge 来帮忙 注意 : 如果是使用 CF __bridge CF -> OC (只完成类型转换)- (void)bridgeCF2OC{CFStringRef aCFString CFStringCreateWithCString(NULL, "b…

php使用TCPDF生成PDF文件教程

functioncreatePdfFile($frontData) { /*新建一个pdf文件&#xff1a; Orientation&#xff1a;orientation属性用来设置文档打印格式是“Portrait”还是“Landscape”。 Landscape为横式打印&#xff0c;Portrait为纵向打印 Unit&#xff1a;设置页面的单位。pt&#xff1a;点…

VUE 框架添加全局公共方法 , 保留小数点后两位

在main.js 里面给Vue对象添加方法。 来一个示例代码&#xff1a; import Vue from vue import App from ./AppVue.prototype.num_to_str_liangwei (val 0) > {return (val / 100).toFixed(2) } App.mpType appconst app new Vue({...App }) app.$mount() 代码添加的…

在Unity中创建3D直升机游戏

In this lecture from Colton Ogden, you can learn game development principles by coding a Helicopter Game 3D using Unity and C#. The principles you learn can apply to any programming language and any game.在Colton Ogden的本次演讲中&#xff0c;您可以通过使用…

洛谷P3572 [POI2014]PTA-Little Bird

P3572 [POI2014]PTA-Little Bird 题目描述 In the Byteotian Line Forest there are nn trees in a row. On top of the first one, there is a little bird who would like to fly over to the top of the last tree. Being in fact very little, the bird might lack the str…

ps aux详解(进程状态说明)

linux上进程有5种状态: 1. 运行(正在运行或在运行队列中等待) 2. 中断(休眠中, 受阻, 在等待某个条件的形成或接受到信号) 3. 不可中断(收到信号不唤醒和不可运行, 进程必须等待直到有中断发生) 4. 僵死(进程已终止, 但进程描述符存在, 直到父进程调用wait4()系统调用后释放) 5…

小程序云开发 一开通云开发,给数据库添加一条记录

先来一个给云数据库添加一条数据库记录的代码&#xff1a; wx.cloud.init({env:school-5k07l})const db wx.cloud.database()const school db.collection(school_db)//school_db是数据库记录的名称&#xff0c;相当于MYSQL中数据库的表的名字school.add({// data 字段表示需新…

spring vertx_如何在Spring设置Vertx

spring vertxby Rick Lee李瑞克(Rick Lee) 如何在Spring设置Vertx (How to set up Vertx in Spring) Spring is probably the most popular framework in the Java space. We all love its dependency injection and all that autowired/configuration magic. It makes unit t…

-lt -gt -ge -le -eq的意义

脚本如下:#!/bin/bashx0while [ $x -lt 10 ]doecho $xxecho "$x1" | bcdone请问这里的-lt是什么意思&#xff0c;请大家指点一二&#xff0c;谢谢。 -lt less than 小于-gt great than 大于-ge great equal 大于等于-le less equal 小于等于-eq equal…

elasticsearch5.5.2环境搭建

运行elasticsearch5.5.2需要jdk1.8版本以上 1.elasticsearch可以去官网或github下载&#xff0c;window系统推荐zip压缩版 2.解压后 进入bin目录运行elasticsearch.bat启动服务 3.访问localhost:9500测试是否成功 4.安装中文分词插件&#xff1a;https://github.com/medcl/elas…

React useState,useEffect ,Hook是什么?什么是副作用?

初步接触 React 中的同学可能会对 useState,useEffect ,Hook,副作用 这些命名比较陌生,一起来了解一下。 Hook是什么? Hook 是钩子,我理解他是一个概念,在不使用class(使用函数)定义一个组件的时候,能用到一些 React 的钩子函数;React 内置了一些像 useState 这样…

塞尔达传说顺序_编码《塞尔达传说》克隆图例

塞尔达传说顺序In this lecture from Colton Ogden, you can learn game development principles by coding a classic Legend of Zelda clone in Lua. The principles you learn can apply to any programming language and any game.在科尔顿奥格登(Colton Ogden)的演讲中&am…

Scrum卡片层次图

对照国内的项目管理软件禅道&#xff0c;可以好好感受一下&#xff0c;何为Scrum。 看板则一定要是实物&#xff0c;才有感觉。 转载于:https://www.cnblogs.com/x3d/p/7500801.html

Linux 中打开tomcat的startup.sh 没有显示successed的方法。

网上下载了tomcat的压缩包&#xff0c;解压到home目录下&#xff0c;然后进入到bin目录下&#xff0c;输入./startup.sh 下面显示如下&#xff1a; 并没有显示successed&#xff0c;但是实际上已经成功启动了tomcat。 去网页上&#xff0c;输入地址、端口号就可以看到tomcat的欢…