Freeze ideas and Notes

Freeze ideas and NotesSomething about DNSWhat is DNS(Domain Name System)?DNS get started

 

Something about DNS

What is DNS(Domain Name System)?

DNS stands for domain name system. If you don’t know what DNS is, please take time to learn more about it as this topic assumes you have a basic understanding of what DNS is. It also assumes that you know how to create DNS records with both your current DNS service and with Managed DNS.

To simplify (probably over-simplify) DNS, it is the mapping of IP addresses (which are actually 32 bit or 128 bit binary numbers) to domain names - which are human friendly strings.

DNS is what turns www.netlify.com 35 into 2604:a880:2:d0::ddf:c001 (or some other IP address).

DNS get started

 

1.Domain Name :

A domain name is the human-friendly name that we are used to associating with an internet resource. For instance, “google.com” is a domain name. Some people will say that the “google” portion is the domain, but we can generally refer to the combined form as the domain name.

The URL “google.com” is associated with the servers owned by Google Inc. The domain name system allows us to reach the Google servers when we type “google.com” into our browsers.

2.IP Address:

An IP address is what we call a network addressable location(网络可寻址位置). Each IP address must be unique within its network. When we are talking about websites, this network is the entire internet.

3.Top-Level Domain:

A top-level domain, or TLD, is the most general part of the domain. The top-level domain is the furthest portion to the right (as separated by a dot). Common top-level domains are “com”, “net”, “org”, “gov”, “edu”, and “io”.

Top-level domains are at the top of the hierarchy in terms of domain names. Certain parties are given management control over top-level domains by ICANN (Internet Corporation for Assigned Names and Numbers). These parties can then distribute domain names under the TLD, usually through a domain registrar.

目前,TLD分为两类:国家代码顶级域名(Country Code Top-Level Domain,简称ccTLD)和通用顶级域名(Generic Top-Level Domain,简称gTLD)。ccTLD是为特定国家或地区保留的域名,例如.cn表示中国、.jp表示日本、.uk表示英国等等。而gTLD则是为特定目的或组织类型保留的域名,例如.com表示商业组织、.org表示非营利组织、.net表示网络基础设施、.edu表示教育机构、.gov表示政府机构等等。

在2012年,ICANN(Internet Corporation for Assigned Names and Numbers)开始接受申请新的gTLD,这导致了许多新的TLD的出现,例如.app、.blog、.club等等。这些新的TLD可以为组织提供更多的域名选择,使得更多的域名可以被注册,并且可以更好地反映特定组织或目的的性质。

4.Hosts:

Within a domain, the domain owner can define individual hosts, which refer to separate computers or services accessible through a domain. For instance, most domain owners make their web servers accessible through the bare domain (example.com) and also through the “host” definition “www” (www.example.com).

You can have other host definitions under the general domain. You could have API access through an “api” host (api.example.com) or you could have ftp access by defining a host called “ftp” or “files” (ftp.example.com or files.example.com). The host names can be arbitrary as long as they are unique for the domain.

Hosts是一个用于存储IP地址和域名映射关系的文本文件。它可以在操作系统级别上设置,用于将特定的域名映射到指定的IP地址上。当计算机需要访问特定的域名时,它会首先检查本地的Hosts文件,如果找到了对应的IP地址映射,就会直接使用该IP地址进行访问,而不需要通过DNS系统进行解析。

Hosts文件通常包含多个条目,每个条目都表示一个IP地址和一个或多个域名之间的映射关系。例如,以下是一个Hosts文件的示例条目:

这个条目表示将localhost映射到IP地址127.0.0.1上,也就是本地主机的回环地址。通过这个映射,计算机可以在本地访问本地主机的服务,例如Web服务器、数据库服务器等等。

Hosts文件在一些情况下非常有用,例如:

  1. 在本地测试Web站点时,可以将域名映射到本地机器上的IP地址,从而避免了将站点部署到远程服务器上的麻烦。
  2. 在防止某些恶意软件通过DNS欺骗攻击来劫持用户浏览器访问的网站时,可以将恶意域名映射到不存在的IP地址,从而阻止恶意软件的攻击。

5.Name server

A name server is a computer designated to translate domain names into IP addresses. These servers do most of the work in the DNS system. Since the total number of domain translations is too much for any one server, each server may redirect request to other name servers or delegate responsibility for a subset of subdomains they are responsible for.

Name servers can be “authoritative”, meaning that they give answers to queries about domains under their control. Otherwise, they may point to other servers, or serve cached copies of other name servers’ data.

Name Server(名称服务器)是一种特殊的服务器,用于存储和管理域名系统(DNS)中的域名及其相应的IP地址等信息。当用户在浏览器中输入一个域名时,系统需要将域名转换为相应的IP地址,以便连接到正确的服务器。

以下是关于Name Server的一些解释:

  1. Name Server的作用:Name Server负责将域名转换为IP地址,并将请求转发到相应的服务器。当用户在浏览器中输入一个域名时,系统首先会查询本地DNS缓存,如果没有找到对应的域名解析,则会向Name Server发起查询请求,获取域名对应的IP地址信息。Name Server还可以处理DNS记录的更新和传播等任务。
  2. Name Server的类型:Name Server可以分为主Name Server和从Name Server。主Name Server是负责某个域名的主要Name Server,它存储着该域名的DNS记录信息,并且可以进行修改和更新。从Name Server则是主Name Server的备份,它存储着主Name Server的副本,以便在主Name Server不可用时提供备用服务。
  3. Name Server的配置:为了使用Name Server,你需要向域名注册商或DNS服务提供商注册一个或多个Name Server。在将域名指向特定的服务器或网站时,你需要在DNS记录中添加相应的A记录或CNAME记录。然后,Name Server会将请求转发到相应的服务器或网站。

总之,Name Server是一种特殊的服务器,用于存储和管理DNS中的域名及其相应的IP地址等信息。它可以处理域名解析、DNS记录的更新和传播等任务。要使用Name Server,你需要向域名注册商或DNS服务提供商注册一个或多个Name Server,并在DNS记录中添加相应的记录。