MDN wants to learn about developers like you:


前提: 首先你得知道 互联网是怎么工作的 并理解 什么是URL
目标: 学习域名是什么,域名的工作方式,以及域名的重要性。


域名(Domain names)是互联网基础架构的关键部分。它们为互联网上任何可用的网页服务器提供了人类可读的地址。

任何连上互联网的电脑都可以通过一个公共IP地址访问到,对于IPv4来说,这个地址由32位组成(它们通常写成四个范围在0~255以内,由点分隔的数字组成,比如173.194.121.32),而对于IPv6来说,这个地址由128位组成,通常写成八组由冒号分隔的四进制数(e.g., 2027:0da8:8b73:0000:0000:8a2e:0370:1337). Computers can handle those addresses easily, but people have a hard time finding out who's running the server or what service the website offers. IP addresses are hard to remember and might change over time. To solve all those problems we use human-readable addresses called domain names.

Active Learning

There is no active learning available yet. Please, consider contributing.

Deeper dive



Anatomy of the MDN domain name


TLD (Top-Level Domain,顶级域名)
顶级域名提供了最多的信息。顶级域名告诉用户通用服务背后的域名。最通用的顶级域名(.com, .org, .net)不需要web服务器满足严格的标准,但一些顶级域名则执行更严格的政策。比如本地的顶级域名,如.us,.fr,或.sh,可以要求必须提供给定语言的服务器或者托管在指定国家。
Label (or component)
The labels are what follow the TLD. A label can be anything, from one letter to a full sentence. The label located right before the TLD can also be referred as a Secondary Level Domain (SLD). A domain name can have many labels (or components), it is not mandatory nor necessary to have 3 labels to form a domain name. For instance, is a correct domain name. When controlling the "upper" part of a domain name (e.g., one can create other domain names (sometimes called "subdomains") (e.g.



你不能 “购买一个域名”,你只能花钱获得一个域名在一年或多年内的使用权。你可以更新你的使用权,然后你的更新将优先于其他人的使用申请。但你从来都没有拥有过域名。

Companies called registrars use domain name registries to keep track of technical and administrative information connecting you to your domain name.

提示 : For some domain name, it might not be a registrar which is in charge of keeping track. For instance, every domain name under .fire is managed by Amazon.



  • 去域名注册商的网站。它们大多会提供"whois"服务,告诉你一个域名是否可用。
  • 另外,如果你使用系统的内置shell,在里面输入whois命令,下面显示的是mozilla.org网站的结果:
$ whois
Domain ID: D1409563-LROR
Creation Date: 1998-01-24T05:00:00Z
Updated Date: 2013-12-08T01:16:57Z
Registry Expiry Date: 2015-01-23T05:00:00Z
Sponsoring Registrar:MarkMonitor Inc. (R37-LROR)
Sponsoring Registrar IANA ID: 292
WHOIS Server:
Referral URL:
Domain Status: clientDeleteProhibited
Domain Status: clientTransferProhibited
Domain Status: clientUpdateProhibited
Registrant ID:mmr-33684
Registrant Name:DNS Admin
Registrant Organization:Mozilla Foundation
Registrant Street: 650 Castro St Ste 300
Registrant City:Mountain View
Registrant State/Province:CA
Registrant Postal Code:94041
Registrant Country:US
Registrant Phone:+1.6509030800



$ whois




  1. 去域名注册商的网站。
  2. 通常那些网站上都有突出的"获得域名"宣传,点击它。
  3. 按要求仔细填表。一定要仔细检查你是否有将你想要的域名拼错。一旦你给错误域名付款了,便为时已晚!
  4. 注册商将会在域名正确注册后通知你。数小时之内,所有DNS服务器都会收到你的DNS信息。

提示: In this process the registrar asks you for your real-world address. Make sure you fill it properly, since in some countries registrars may be forced to close the domain if they cannot provide a valid address.

DNS refreshing

DNS databases are stored on every DNS server worldwide, and all these servers refer to a few ones called “authoritative name server” or “top-level DNS servers.” Whenever your registrar creates or updates any information for a given domain, the information must be refreshed in every DNS database. Each DNS server that knows about a given domain stores the information for some time before it is automatically invalidated and then refreshed (the DNS server queries an authoritative server again). Thus, it takes some time for DNS servers that know about this domain name to get the up-to-date information.

Note : This time is often called propagation time. However this term is not precise since the update is not propagating itself (top → down). DNS servers queried by your computer (down) are the ones that fetch the information from the authoritative server (top) when they need it.


As we already saw, when you want to display a webpage in your browser it's easier to type a domain name than an IP address. Let's take a look at the process:

  1. 在你的浏览器地址栏输入。
  2. Your browser asks your computer if it already recognizes the IP address identified by this domain name (using a local DNS cache). If it does, the name is translated to the IP address and the browser negotiates contents with the web server. End of story.
  3. If your computer does not know which IP is behind the name, it goes on to ask a DNS server, whose job is precisely to tell your computer which IP address matches each registered domain name.
  4. Now that the computer knows the requested IP address, your browser can negotiate contents with the web server.

Explanation of the steps needed to obtain the result to a DNS request


Okay, we talked a lot about processes and architecture. Time to move on.


 此页面的贡献者: ziyunfei, wth
 最后编辑者: ziyunfei,