English Version:
This is lesson 1: IP and Domain name. That means: how a navigator like IE or FireFox know where is news.google.com, www.yahoo.com or yourdamain.com(like liuzhy.com,
).
As you knows: you can visit my blog, you are connecting to INTERNET. No matter what you are using: wire or wireless.
Like a person in society, every one need a ID, this ID will never as the same to others, if it happened, maybe you or him will be troubled, and a department will solve it quickly. Internet is similar. Each device connected to it must have an ONLY ID named IP address. Each device means: Mobile phone, Notebook, Mac, Wii, and even a router(it’s a box with cables). Here is a question, if you visit my blog in your company or a net cafe, that’s diff. you can check your IP, it should like 10.x.x.x or 192.168.x.x, that’s not your real IP, when you connect to a website,it will know you real IP in internet. Is it diffcult to undersand? take it easy, what’s you should know is: an ONLY IP is needed if you connect to internte.
OK, Next is domain name. it is easy to understand: like google.com, vol.com and a famous website: liuzhy.com,ha..If you type it in your navigator’s address bar and Enter, a page will be shown. but… wait, the google.com must had a server machine(s) to service you, it is a device in internet, it must have a IP. How a domain to a IP? because there are lots of devices named DNS server to solve it.
Now, let’s visite google.com more one time: you type “www.google.com” and enter. What’s the navigator doing is look for “google.com” ‘s IP address, so it send a request to the closest DNS server. and the DNS server reponse: google.com = xx.xx.xx.xx, now navigator navigate to xx.xx.xx.xx. So you open the page and happy to search anything.
Of cause, this ia luck. In most cases, you type “blog.liuzhy.com” and your closest DNS server don’t know that’s the IP, so “liuzhy.com=?” message will be sent from this DNS to another and to another until a DNS server knows. Are these DNS servers is fool? no, there’s a set of rules to guarantee spending a little time, that’s no need to know.
That’s how IP and domain name and DNS works. If you buy a domain name and make it to your own IP:xx.xx.xx.xx, you should waiting for 2 to 24 hours until every DNS server know “yourdomain = xx.xx.xx.xx”. Before it, you can visit your website by using xx.xx.xx.xx. If it’s still invalid, you should check you internet connection, your website IP, your script error, or even a security reason(in some area, numbers of IP was banned..hnnn). If you don’t know this, you can post your problem here, I would try to help you.
That’s the lesson 1, easy to know.
中文版本:
今天,我想主要介绍的是IP地址和域名。也就是说:当你输入news.google.com或者www.yahoo.com的时候,你的浏览器是如何找到这个网站并实现一些功能(比如看新闻,登录论坛,搜索等)。
众所周知,我们的电脑是通过种种方式连接到互联网上的,无论是网线、光纤或者是电话线、蓝牙、无线网络等等,既然你能看到我的博客,说明你能连接到互联网。
就像人在社会上活动一样,我们需要名字和身份证号,很多人都叫张三李四,但是身份证号是不应该有相同的,如果有两个人的身份证号相同了……呃,会有相应的机构来处理这件事儿。互联网上的各种设备也是一样,无论是你的电脑或者是大型网站的服务器甚至是为电脑指路的设备,都是有身份证号的,这就是IP地址。理论上,互联网上的ip地址是不应该有重合的,但是有时候,一个IP可能被多人所用,比如在网吧或者是公司。这时候,就有相应的设备去区分互联网与公司(网吧)内部IP,这个无需过问。因为当你通过网吧访问google的时候,google只会针对那个接入互联网IP,而不是你机器的IP……或许有些拗口,但是这无关紧要,你只要记住,当你能上网的时候,一定有一个在互联网上是唯一的IP作为你访问的标识,也就是你的身份证。
同样,百度或者新浪或者淘宝,既然你能够访问到他们,说明……他们也一定有IP身份证。但是IP身份证很复杂,是一连串的数字,为什么你不用记住这串数字而只要输入:baidu.com、sina.com.cn、 taobao.com(这些叫做域名)就能看到网页呢?其实很简单。网络中间有很多用来把baidu.com 和它的IP对应的设备,这些设备学名叫做DNS。当你在浏览器中输入:baidu.com的时候,你的电脑并不知道这是哪里,于是它就向离它最近的DNS询问:baidu.com是哪里啊?如果幸运的话,这个DNS会告诉你的浏览器是xx.xx.xx.xx(IP地址),你的浏览器就会直接连到那里,打开网页准备等待你的下一步动作;但是大多数时候是不幸的,离你最近的DNS是乡村DNS,他并不知道baidu.com在哪里,于是它又会向另外一个它觉得比较靠谱的DNS询问:你知道baidu.com在哪里吗?……以此类推,总有一个DNS会知道,于是一传十十传百,你的浏览器也会知道。当然,在第二种情况里,DNS会根据一些规则,向特定的其他DNS来询问,而不是胡乱询问,不然……会很浪费时间。
这就是IP和域名是如何统一起来的。对应到建立网站上面,就是:你申请了域名liuzhy.com,并把它对应到了xx.xx.xx.xx这个IP地址……但是你用浏览器一打开:找不到网站。这并不是什么令人害怕的问题,你需要等等,等管理liuzhy.com域名的DNS告诉其余的DNS:liuzhy.com是归我管的。这个过程,往往需要2-24小时。再此之前,你可以使用IP地址来访问你的网站。如果,连IP地址都不能访问的话 – 就需要找原因了:或许你并没有打开你的adsl,或许你们国家的防火墙认为你的IP不安全,或许……当然,如果你遇到了这类问题,可以在后面问我,会尽量帮助你解决它。谢谢,第一课结束了。

近期评论