
不请自来。先和你说一下域名吧。我们现在访问一个域名的时候,电脑都是先从域名的最后开始查找起来的。
简单的用百度说一下吧。比如你要访问百度,一般都是域名“www.baidu,com”访问的,电脑都是先从本地缓存内查找,看解析文件内有没有域名对应的IP,如果没有,就去根域查,找不到的情况,找顶级域名com,之后找baidu,在baidu的服务器内如果有DNS服务器,DNS服务器会把www主机的IP反馈,你有了www的IP,就可以访问www.baidu.com了。
但是百度不止一个www的服务(在这里就不说负载均衡了),你可能还需要访问贴吧啊,图片啊什么的,他可以把一个3级域名放入一个真实主机,比如你要进入"tieba.baidu.com",那你的电脑需要找到贴吧的主机IP。
上面说的是过程,其实也就显示出来DNS服务器的作用了,简单的说,就是告知别人,自己的每台服务器对应的IP,使得别人可以访问。
我只是把我理解的,跟你分享一下,不知道这么跟你解释,你能不能接受,如果回答的有问题,请大家多多指教。谢谢
aphache的作用是用于提供网站服务(当然网站还要自己设置)相当于windows的iisdns服务器的作用是提供域名解析服务,既把www.baidu.com这个样的网址解析成ip地址,
或者反向的可根据ip地址查询域名
DNS是域名解析,被注释掉了的话就不能解析域名了,给你看看域名解析的相关配置了解一下:
root@jaking-virtual-machine:~# cat /etc/resolv.conf# This file is managed by man:systemd-resolved(8). Do not edit.
#
# This is a dynamic resolv.conf file for connecting local clients to the
# internal DNS stub resolver of systemd-resolved. This file lists all
# configured search domains.
#
# Run "systemd-resolve --status" to see details about the uplink DNS servers
# currently in use.
#
# Third party programs must not access this file directly, but only through the
# symlink at /etc/resolv.conf. To manage man:resolv.conf(5) in a different way,
# replace this symlink by a static file or a different symlink.
#
# See man:systemd-resolved.service(8) for details about the supported modes of
# operation for /etc/resolv.conf.
nameserver 127.0.0.53
search localdomain
更多知识请百度《Linux就该这么学》
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)