DNS in Detail

What is DNS

DNS (Domain Name System): 访问google不需要记住142.250.190.46(IP address),只要记住google.com 这就是DNS的作用

Domain Hierarchy(域名层级)

https://tryhackme-images.s3.amazonaws.com/user-uploads/5c549500924ec576f953d9fc/room-content/a168c8511887fff98a6944619c4b5259.png

TLD (Top-Level Domain)

即域名最右边部分

Two types of TLD

  • gTLD (Generic Top Level) :Historically a gTLD was meant to tell the user the domain name's purpose.(表示域名的用途)

    如: .com would be for commercial purposes .org for an organization .edu for education .gov for government.

  • ccTLD (Country Code Top Level Domain):ccTLD was used for geographical purposes(表示地理标识)

.ca for sites based in Canada, .co.uk for sites based in the United Kingdom

Second-Level Domain

Taking google.com as an example, the .com part is the TLD, and google is the Second Level Domain.

the second-level domain is limited to 63 characters + the TLD and can only use a-z 0-9 and -(hyphen)(cannot start or end with hyphens or have consecutive hyphens).63个字符, -不能在头也不能在尾, 不能--

Subdomain

域名最左边部分

如:admin.tryhackme.com the admin part is the subdomain.

和Second-Level Domain构成规则一样 But the length must be kept to 253 characters or less. 在253以内可以创造多个Subdomain

Record Types

Linux下演示DNS

Making a Request

https://tryhackme-images.s3.amazonaws.com/user-uploads/5f04259cf9bf5b57aed2c476/room-content/5f04259cf9bf5b57aed2c476-1724075620083.png

  1. When you request a domain name, your computer first checks its local cache(本地缓存) to see if you've previously looked up the address recently; if not, a request to your Recursive DNS Server will be made.[电脑会先检查本地缓存,缓存没有就向递归DNS服务器发起请求]

  2. A Recursive DNS Server is usually provided by your ISP(Internet Service Provider), but you can also choose your own. This server also has a local cache of recently looked up domain names. If a result is found locally, this is sent back to your computer, and your request ends here (this is common for popular and heavily requested services such as Google, Facebook, Twitter). If the request cannot be found locally, a journey begins to find the correct answer, starting with the internet's root DNS servers.热门网站(如谷歌)的解析结果常存于此,缓存无结果则开始从根服务器查询

  3. The root servers act as the DNS backbone(支柱) of the internet; their job is to redirect you to the correct Top Level Domain Server, depending on your request. If, for example, you request www.tryhackme.com, the root server will recognize the Top Level Domain of .com and refer you to the correct TLD server that deals with .com addresses.根服务器是DNS核心支柱,不直接返回IP,只指引对应顶级域(TLD)服务器

  4. The TLD server holds records for where to find the authoritative server to answer the DNS request. The authoritative server is often also known as the nameserver for the domain. For example, the name server for tryhackme.com is kip.ns.cloudflare.com and uma.ns.cloudflare.com. You'll often find multiple nameservers for a domain name to act as a backup in case one goes down. TLD服务器存储权威DNS服务器地址(权威服务器又称域名的名称服务器);域名常设置多个权威服务器作为备份,避免宕机

  5. An authoritative DNS server is the server that is responsible for storing the DNS records for a particular domain name and where any updates to your domain name DNS records would be made. Depending on the record type, the DNS record is then sent back to the Recursive DNS Server, where a local copy will be cached for future requests and then relayed back to the original client that made the request. DNS records all come with a TTL (Time To Live) value. This value is a number represented in seconds that the response should be saved for locally until you have to look it up again. Caching saves on having to make a DNS request every time you communicate with a server.权威DNS服务器负责存储域名的所有DNS记录(更新也在此操作);解析结果返回递归服务器后会缓存,搭配TTL(生存时间,单位秒),避免重复查询、提升速度

Logo

昇腾计算产业是基于昇腾系列(HUAWEI Ascend)处理器和基础软件构建的全栈 AI计算基础设施、行业应用及服务,https://devpress.csdn.net/organization/setting/general/146749包括昇腾系列处理器、系列硬件、CANN、AI计算框架、应用使能、开发工具链、管理运维工具、行业应用及服务等全产业链

更多推荐