标签:tao -- 主机 lookup ilb 系统 sbt change sina
DNS(Domain Name System,域名系统),因特网上作为域名和IP地址相互映射的一个分布式数据库,能够使用户更方便的访问互联网,而不用去+·记住能够被机器直接读取的IP数串。
通过主机名,最终得到该主机名对应的IP地址的过程叫做域名解析(或主机名解析)。
DNS协议运行在UDP协议之上,使用端口号53。
访问网站的实质就是解析其域名得到IP地址,再转向其网站。
就是将浏览器中的 www.baidu.com 通过DNS解析得到IP地址:183.232.231.172
A记录的解析过程:
浏览器--> www.etiantian.org --> 网站服务器的ip地址 --> ip地址对应的网站服务器
原理步骤:
如果有,就直接访问这个IP地址所对应的www.baidu.com 域名服务器.
# macbook的hosts文件信息 192:etc zoe$ cat /etc/hosts ## # Host Database # # localhost is used to configure the loopback interface # when the system is booting. Do not change this entry. ## 127.0.0.1 localhost 255.255.255.255 broadcasthost ::1 localhost 139.224.179.40 dcba 10.86.212.19 pi01 10.86.212.56 pi02 # 虚拟机上linux的hosts信息 [root@oldboy ~]# cat /etc/hosts 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
DNS数据库的结构如下图所示,就像一棵倒挂着的树。
它的顶点也是根(.)
全球总共有 13台 根DNS服务器。
顶级域名 org, com, net, me, cc,
一级域名:baidu, sina, google, alibaba, taobao
192:etc zoe$ dig @8.8.8.8 www.baidu.com +trace ; <<>> DiG 9.10.6 <<>> @8.8.8.8 www.baidu.com +trace ; (1 server found) ;; global options: +cmd . 211565 IN NS a.root-servers.net. . 211565 IN NS b.root-servers.net. . 211565 IN NS c.root-servers.net. . 211565 IN NS d.root-servers.net. . 211565 IN NS e.root-servers.net. . 211565 IN NS f.root-servers.net. . 211565 IN NS g.root-servers.net. . 211565 IN NS h.root-servers.net. . 211565 IN NS i.root-servers.net. . 211565 IN NS j.root-servers.net. . 211565 IN NS k.root-servers.net. . 211565 IN NS l.root-servers.net. . 211565 IN NS m.root-servers.net. . 211565 IN RRSIG NS 8 0 518400 20191005050000 20190922040000 59944 . kFUBbJE9raFU30U6hkdXdjkSmMeokgUl7GMZokb1cX7XAIXMuJSlqtxP 1zouEX6o/49O4pwIJL8DlCOpAJ+Fk84xbY+0i32BAlkTPBd6KwqU7Fra UaKe1a6ylMFg6Ov4kaTpL/Y4njrobc3N+FL0pBZX6/hH5ltNVyutpiDt 3ZXWjCqHy8tJcd/MV4zIbvlLZ52cLCufzIxAVQrbryg4tpkkUrb+BiR8 VYuBG/y+RToCZRgmf3vTX06G3RKADwcOBiBj0jt/RQMCZjC4BGdTD/H9 bwyaKEXRjCi53AspEDfI7hF+uPHB+Fd+lRa9rjGi5jyf+e56dKg6IKsp 1VqSSQ== ;; Received 525 bytes from 8.8.8.8#53(8.8.8.8) in 200 ms com. 172800 IN NS l.gtld-servers.net. com. 172800 IN NS b.gtld-servers.net. com. 172800 IN NS c.gtld-servers.net. com. 172800 IN NS d.gtld-servers.net. com. 172800 IN NS e.gtld-servers.net. com. 172800 IN NS f.gtld-servers.net. com. 172800 IN NS g.gtld-servers.net. com. 172800 IN NS a.gtld-servers.net. com. 172800 IN NS h.gtld-servers.net. com. 172800 IN NS i.gtld-servers.net. com. 172800 IN NS j.gtld-servers.net. com. 172800 IN NS k.gtld-servers.net. com. 172800 IN NS m.gtld-servers.net. com. 86400 IN DS 30909 8 2 E2D3C916F6DEEAC73294E8268FB5885044A833FC5459588F4A9184CF C41A5766 com. 86400 IN RRSIG DS 8 1 86400 20191006050000 20190923040000 59944 . Pe9CAXBj4SVoH+viy4eJMGSCOQZPWyPH6sOoNRE1O7ScsqdNPqaLBLYt DRXEAmwC+wKiqiLbwTcIzQbraifFDOeftMXeA4Zx23AXuuU2w84PWe1h 0TqgQwGyZnEIhbEj9OryhTvc/LcC1Govyk6cgDhJhxVNy3A2fhDU5eOp KcbxEp5VeLMtilQMdrjPSMQAy8RNDgoHvd5YBmpjUlGquvpASHEItZlZ hT6dWQYSqroI4ruyt6xCvrcKCma2nyR78FcZZLdg2jTJFaBsOaAsnI0V nfrWXsD09S4EvTHq+SIEIHyvJgC2+HKScUUlJgXTDAdd0zLxlQqW4fcn z5xhyQ== ;; Received 1173 bytes from 192.5.5.241#53(f.root-servers.net) in 41 ms baidu.com. 172800 IN NS ns2.baidu.com. baidu.com. 172800 IN NS ns3.baidu.com. baidu.com. 172800 IN NS ns4.baidu.com. baidu.com. 172800 IN NS ns1.baidu.com. baidu.com. 172800 IN NS ns7.baidu.com. CK0POJMG874LJREF7EFN8430QVIT8BSM.com. 86400 IN NSEC3 1 1 0 - CK0Q1GIN43N1ARRC9OSM6QPQR81H5M9A NS SOA RRSIG DNSKEY NSEC3PARAM CK0POJMG874LJREF7EFN8430QVIT8BSM.com. 86400 IN RRSIG NSEC3 8 2 86400 20190928044441 20190921033441 17708 com. G131mLtsBTVuH1wpOFbRs0/voaY+V7rxVJHc9XWhCelqZkbFiB6tVxKw oqpWdiXL+p4V40G3Koo8Y7y/Qd2M+hV4edC0nal1RrNt97hkRLQAcTJ/ wHZcMl84JbDtZT44UY1iHWv4GUxlxyaQiew/YceADjSzNtqG8mU1zNhC P1g= HPVV2B5N85O7HJJRB7690IB5UVF9O9UA.com. 86400 IN NSEC3 1 1 0 - HPVVN3Q5E5GOQP2QFE2LEM4SVB9C0SJ6 NS DS RRSIG HPVV2B5N85O7HJJRB7690IB5UVF9O9UA.com. 86400 IN RRSIG NSEC3 8 2 86400 20190930045238 20190923034238 17708 com. k5LZWJ8Oa5v6NqVOZ9PUeDx0vdwV6gFSH0EZp9rFHr9GeAYPOnr0ucQX XogUAJweh+CvXYMqFa3s3ZQUsqbRv2O5XTjKuZDrOzBSPooK3csZ1tJy q5HdJczJeMVTdHsbaVcO2Kt1Iwl+5Obl8UCt60ZfyTQoegAI+dtQdPNa ADA= ;; Received 697 bytes from 192.41.162.30#53(l.gtld-servers.net) in 266 ms www.baidu.com. 1200 IN CNAME www.a.shifen.com. a.shifen.com. 1200 IN NS ns3.a.shifen.com. a.shifen.com. 1200 IN NS ns4.a.shifen.com. a.shifen.com. 1200 IN NS ns5.a.shifen.com. a.shifen.com. 1200 IN NS ns2.a.shifen.com. a.shifen.com. 1200 IN NS ns1.a.shifen.com. ;; Received 239 bytes from 14.215.178.80#53(ns4.baidu.com) in 42 ms 192:etc zoe$ 192:etc zoe$ dig @8.8.8.8 www.baidu.com +trace ; <<>> DiG 9.10.6 <<>> @8.8.8.8 www.baidu.com +trace ; (1 server found) ;; global options: +cmd . 197496 IN NS a.root-servers.net. . 197496 IN NS b.root-servers.net. . 197496 IN NS c.root-servers.net. . 197496 IN NS d.root-servers.net. . 197496 IN NS e.root-servers.net. . 197496 IN NS f.root-servers.net. . 197496 IN NS g.root-servers.net. . 197496 IN NS h.root-servers.net. . 197496 IN NS i.root-servers.net. . 197496 IN NS j.root-servers.net. . 197496 IN NS k.root-servers.net. . 197496 IN NS l.root-servers.net. . 197496 IN NS m.root-servers.net. . 197496 IN RRSIG NS 8 0 518400 20191005050000 20190922040000 59944 . kFUBbJE9raFU30U6hkdXdjkSmMeokgUl7GMZokb1cX7XAIXMuJSlqtxP 1zouEX6o/49O4pwIJL8DlCOpAJ+Fk84xbY+0i32BAlkTPBd6KwqU7Fra UaKe1a6ylMFg6Ov4kaTpL/Y4njrobc3N+FL0pBZX6/hH5ltNVyutpiDt 3ZXWjCqHy8tJcd/MV4zIbvlLZ52cLCufzIxAVQrbryg4tpkkUrb+BiR8 VYuBG/y+RToCZRgmf3vTX06G3RKADwcOBiBj0jt/RQMCZjC4BGdTD/H9 bwyaKEXRjCi53AspEDfI7hF+uPHB+Fd+lRa9rjGi5jyf+e56dKg6IKsp 1VqSSQ== ;; Received 525 bytes from 8.8.8.8#53(8.8.8.8) in 265 ms com. 172800 IN NS l.gtld-servers.net. com. 172800 IN NS b.gtld-servers.net. com. 172800 IN NS c.gtld-servers.net. com. 172800 IN NS d.gtld-servers.net. com. 172800 IN NS e.gtld-servers.net. com. 172800 IN NS f.gtld-servers.net. com. 172800 IN NS g.gtld-servers.net. com. 172800 IN NS a.gtld-servers.net. com. 172800 IN NS h.gtld-servers.net. com. 172800 IN NS i.gtld-servers.net. com. 172800 IN NS j.gtld-servers.net. com. 172800 IN NS k.gtld-servers.net. com. 172800 IN NS m.gtld-servers.net. com. 86400 IN DS 30909 8 2 E2D3C916F6DEEAC73294E8268FB5885044A833FC5459588F4A9184CF C41A5766 com. 86400 IN RRSIG DS 8 1 86400 20191006050000 20190923040000 59944 . Pe9CAXBj4SVoH+viy4eJMGSCOQZPWyPH6sOoNRE1O7ScsqdNPqaLBLYt DRXEAmwC+wKiqiLbwTcIzQbraifFDOeftMXeA4Zx23AXuuU2w84PWe1h 0TqgQwGyZnEIhbEj9OryhTvc/LcC1Govyk6cgDhJhxVNy3A2fhDU5eOp KcbxEp5VeLMtilQMdrjPSMQAy8RNDgoHvd5YBmpjUlGquvpASHEItZlZ hT6dWQYSqroI4ruyt6xCvrcKCma2nyR78FcZZLdg2jTJFaBsOaAsnI0V nfrWXsD09S4EvTHq+SIEIHyvJgC2+HKScUUlJgXTDAdd0zLxlQqW4fcn z5xhyQ== ;; Received 1173 bytes from 192.203.230.10#53(e.root-servers.net) in 41 ms baidu.com. 172800 IN NS ns2.baidu.com. baidu.com. 172800 IN NS ns3.baidu.com. baidu.com. 172800 IN NS ns4.baidu.com. baidu.com. 172800 IN NS ns1.baidu.com. baidu.com. 172800 IN NS ns7.baidu.com. CK0POJMG874LJREF7EFN8430QVIT8BSM.com. 86400 IN NSEC3 1 1 0 - CK0Q1GIN43N1ARRC9OSM6QPQR81H5M9A NS SOA RRSIG DNSKEY NSEC3PARAM CK0POJMG874LJREF7EFN8430QVIT8BSM.com. 86400 IN RRSIG NSEC3 8 2 86400 20190928044441 20190921033441 17708 com. G131mLtsBTVuH1wpOFbRs0/voaY+V7rxVJHc9XWhCelqZkbFiB6tVxKw oqpWdiXL+p4V40G3Koo8Y7y/Qd2M+hV4edC0nal1RrNt97hkRLQAcTJ/ wHZcMl84JbDtZT44UY1iHWv4GUxlxyaQiew/YceADjSzNtqG8mU1zNhC P1g= HPVV2B5N85O7HJJRB7690IB5UVF9O9UA.com. 86400 IN NSEC3 1 1 0 - HPVVN3Q5E5GOQP2QFE2LEM4SVB9C0SJ6 NS DS RRSIG HPVV2B5N85O7HJJRB7690IB5UVF9O9UA.com. 86400 IN RRSIG NSEC3 8 2 86400 20190930045238 20190923034238 17708 com. k5LZWJ8Oa5v6NqVOZ9PUeDx0vdwV6gFSH0EZp9rFHr9GeAYPOnr0ucQX XogUAJweh+CvXYMqFa3s3ZQUsqbRv2O5XTjKuZDrOzBSPooK3csZ1tJy q5HdJczJeMVTdHsbaVcO2Kt1Iwl+5Obl8UCt60ZfyTQoegAI+dtQdPNa ADA= ;; Received 697 bytes from 192.43.172.30#53(i.gtld-servers.net) in 192 ms www.baidu.com. 1200 IN CNAME www.a.shifen.com. a.shifen.com. 1200 IN NS ns4.a.shifen.com. a.shifen.com. 1200 IN NS ns1.a.shifen.com. a.shifen.com. 1200 IN NS ns3.a.shifen.com. a.shifen.com. 1200 IN NS ns5.a.shifen.com. a.shifen.com. 1200 IN NS ns2.a.shifen.com. ;; Received 239 bytes from 14.215.178.80#53(ns4.baidu.com) in 43 ms
[root@oldboy ~]# nslookup > baidu.com Server: 192.168.1.1 Address: 192.168.1.1#53 Non-authoritative answer: Name: baidu.com Address: 39.156.69.79 Name: baidu.com Address: 220.181.38.148
[root@oldboy ~]# host www.baidu.com www.baidu.com is an alias for www.a.shifen.com. www.a.shifen.com has address 183.232.231.174 www.a.shifen.com has address 183.232.231.172
[root@oldboy ~]# ping www.baidu.com PING www.baidu.com (183.232.231.174) 56(84) bytes of data. 64 bytes from 183.232.231.174: icmp_seq=1 ttl=55 time=43.8 ms 64 bytes from 183.232.231.174: icmp_seq=2 ttl=55 time=44.2 ms
标签:tao -- 主机 lookup ilb 系统 sbt change sina
原文地址:https://www.cnblogs.com/zoe233/p/11823857.html