65.jpg?x-oss-process=image/auto-orient,1/quality,q_90/watermark,image_bG9nby5wbmc_eC1vc3MtcHJvY2Vzcz1pbWFnZS9yZXNpemUsUF8yMA,g_center,t_50,x_10,y_10

域名解析是把域名指向网站空间的IP,让人们通过注册的域名可方便地访问到网站的一种服务。IP地址是网络上标识站点的数字地址,为了方便记忆,采用域名来代替IP地址标识站点地址。域名解析是域名到IP地址的转换过程。域名的解析工作由DNS服务器完成。

服务架构

服务架构如下,左侧为客户端,右侧为服务端,中间为请求的流程:

65-1.jpg?x-oss-process=image/auto-orient,1/quality,q_90/watermark,image_bG9nby5wbmc_eC1vc3MtcHJvY2Vzcz1pbWFnZS9yZXNpemUsUF8yMA,g_center,t_50,x_10,y_10

专有名词

  1. 正向解析:域名解析成IP地址;

  2. 反向解析:IP地址解析成域名;

  3. 主机解析:也称为A解析,是将域名解析成IP地址;

  4. 别名解析:也称为CNAME解析,是将域名解析域名。需要注意的是,最终的域名仍需要解析成IP。

服务设置

Server2019默认不会安装DNS,需要自行安装。点击仪表板上的添加角色和功能:

65-2.jpg?x-oss-process=image/auto-orient,1/quality,q_90/watermark,image_bG9nby5wbmc_eC1vc3MtcHJvY2Vzcz1pbWFnZS9yZXNpemUsUF8yMA,g_center,t_50,x_10,y_10

在添加角色和功能向导页面中点击下一步:

65-3.jpg?x-oss-process=image/auto-orient,1/quality,q_90/watermark,image_bG9nby5wbmc_eC1vc3MtcHJvY2Vzcz1pbWFnZS9yZXNpemUsUF8yMA,g_center,t_50,x_10,y_10

我们可以将服务安装在本机,也可以安装在远程服务器上,这里选择基于角色或基于功能的安装,然后点下一步:

65-4.jpg?x-oss-process=image/auto-orient,1/quality,q_90/watermark,image_bG9nby5wbmc_eC1vc3MtcHJvY2Vzcz1pbWFnZS9yZXNpemUsUF8yMA,g_center,t_50,x_10,y_10

选从服务器池中选择服务器,目前服务器池只有当前的服务器,然后点下一步:

65-5.jpg?x-oss-process=image/auto-orient,1/quality,q_90/watermark,image_bG9nby5wbmc_eC1vc3MtcHJvY2Vzcz1pbWFnZS9yZXNpemUsUF8yMA,g_center,t_50,x_10,y_10

在列表中选择角色,勾选DNS服务器:

65-6.jpg?x-oss-process=image/auto-orient,1/quality,q_90/watermark,image_bG9nby5wbmc_eC1vc3MtcHJvY2Vzcz1pbWFnZS9yZXNpemUsUF8yMA,g_center,t_50,x_10,y_10

勾选后会弹出添加功能确认界面,它会安装除了服务之外的相关工具和组件:

65-7.jpg?x-oss-process=image/auto-orient,1/quality,q_90/watermark,image_bG9nby5wbmc_eC1vc3MtcHJvY2Vzcz1pbWFnZS9yZXNpemUsUF8yMA,g_center,t_50,x_10,y_10

弹出错误提示,需要给服务设置静态IP地址。如果不用静态的IP地址,可能会发生IP变动,这样别人就无法正常使用DNS。我们可以现在设置,也可以安装好服务之后设置,然后点击继续:

65-8.jpg?x-oss-process=image/auto-orient,1/quality,q_90/watermark,image_bG9nby5wbmc_eC1vc3MtcHJvY2Vzcz1pbWFnZS9yZXNpemUsUF8yMA,g_center,t_50,x_10,y_10

经过上面的操作后,会发现DNS服务器角色已经被勾选,然后点下一步:

65-9.jpg?x-oss-process=image/auto-orient,1/quality,q_90/watermark,image_bG9nby5wbmc_eC1vc3MtcHJvY2Vzcz1pbWFnZS9yZXNpemUsUF8yMA,g_center,t_50,x_10,y_10

接下来是功能选择,无需勾选任何,点下一步:

65-10.jpg?x-oss-process=image/auto-orient,1/quality,q_90/watermark,image_bG9nby5wbmc_eC1vc3MtcHJvY2Vzcz1pbWFnZS9yZXNpemUsUF8yMA,g_center,t_50,x_10,y_10

显示注意事项,无需理会,直接点下一步:

65-11.jpg?x-oss-process=image/auto-orient,1/quality,q_90/watermark,image_bG9nby5wbmc_eC1vc3MtcHJvY2Vzcz1pbWFnZS9yZXNpemUsUF8yMA,g_center,t_50,x_10,y_10

接下来是角色添加确认界面,点击安装即可:

65-12.jpg?x-oss-process=image/auto-orient,1/quality,q_90/watermark,image_bG9nby5wbmc_eC1vc3MtcHJvY2Vzcz1pbWFnZS9yZXNpemUsUF8yMA,g_center,t_50,x_10,y_10

稍等一会安装成功,点击关闭:

65-13.jpg?x-oss-process=image/auto-orient,1/quality,q_90/watermark,image_bG9nby5wbmc_eC1vc3MtcHJvY2Vzcz1pbWFnZS9yZXNpemUsUF8yMA,g_center,t_50,x_10,y_10

添加好角色后,又回到了初始界面,点击下面的DNS即可进入角色:

65-14.jpg?x-oss-process=image/auto-orient,1/quality,q_90/watermark,image_bG9nby5wbmc_eC1vc3MtcHJvY2Vzcz1pbWFnZS9yZXNpemUsUF8yMA,g_center,t_50,x_10,y_10

留意服务器IP地址,一会需要用到:

65-15.jpg?x-oss-process=image/auto-orient,1/quality,q_90/watermark,image_bG9nby5wbmc_eC1vc3MtcHJvY2Vzcz1pbWFnZS9yZXNpemUsUF8yMA,g_center,t_50,x_10,y_10

然后我们开始配置,在右上角的工具处,选DNS:

65-16.jpg?x-oss-process=image/auto-orient,1/quality,q_90/watermark,image_bG9nby5wbmc_eC1vc3MtcHJvY2Vzcz1pbWFnZS9yZXNpemUsUF8yMA,g_center,t_50,x_10,y_10

双击名称处的服务器名:

65-17.jpg?x-oss-process=image/auto-orient,1/quality,q_90/watermark,image_bG9nby5wbmc_eC1vc3MtcHJvY2Vzcz1pbWFnZS9yZXNpemUsUF8yMA,g_center,t_50,x_10,y_10

我们看到列出很多内容,这里不做解释,双击正向查询区域:

65-18.jpg?x-oss-process=image/auto-orient,1/quality,q_90/watermark,image_bG9nby5wbmc_eC1vc3MtcHJvY2Vzcz1pbWFnZS9yZXNpemUsUF8yMA,g_center,t_50,x_10,y_10

这里我们需要添加一个域名:

65-19.jpg?x-oss-process=image/auto-orient,1/quality,q_90/watermark,image_bG9nby5wbmc_eC1vc3MtcHJvY2Vzcz1pbWFnZS9yZXNpemUsUF8yMA,g_center,t_50,x_10,y_10

点击上面的操作键,点选新建区域:

65-20.jpg?x-oss-process=image/auto-orient,1/quality,q_90/watermark,image_bG9nby5wbmc_eC1vc3MtcHJvY2Vzcz1pbWFnZS9yZXNpemUsUF8yMA,g_center,t_50,x_10,y_10

系统会弹出新建区域的向导,欢迎页面无需处理,直接点下一步:

65-21.jpg?x-oss-process=image/auto-orient,1/quality,q_90/watermark,image_bG9nby5wbmc_eC1vc3MtcHJvY2Vzcz1pbWFnZS9yZXNpemUsUF8yMA,g_center,t_50,x_10,y_10

这里有三个可选项,我们选择主要区域:

65-22.jpg?x-oss-process=image/auto-orient,1/quality,q_90/watermark,image_bG9nby5wbmc_eC1vc3MtcHJvY2Vzcz1pbWFnZS9yZXNpemUsUF8yMA,g_center,t_50,x_10,y_10

然后输入我们要解析的域名:

65-23.jpg?x-oss-process=image/auto-orient,1/quality,q_90/watermark,image_bG9nby5wbmc_eC1vc3MtcHJvY2Vzcz1pbWFnZS9yZXNpemUsUF8yMA,g_center,t_50,x_10,y_10

系统会自动生成一个域名的文件,默认即可,点下一步:

65-24.jpg?x-oss-process=image/auto-orient,1/quality,q_90/watermark,image_bG9nby5wbmc_eC1vc3MtcHJvY2Vzcz1pbWFnZS9yZXNpemUsUF8yMA,g_center,t_50,x_10,y_10

是否允许自动更新,我们选否,这样只有我们自己才能修改:

65-25.jpg?x-oss-process=image/auto-orient,1/quality,q_90/watermark,image_bG9nby5wbmc_eC1vc3MtcHJvY2Vzcz1pbWFnZS9yZXNpemUsUF8yMA,g_center,t_50,x_10,y_10

到这里域名就添加完成,我们点击完成关闭窗口:

65-26.jpg?x-oss-process=image/auto-orient,1/quality,q_90/watermark,image_bG9nby5wbmc_eC1vc3MtcHJvY2Vzcz1pbWFnZS9yZXNpemUsUF8yMA,g_center,t_50,x_10,y_10

接下来会在窗口中,看到我们刚添加的域名,双击域名进入配置:

65-27.jpg?x-oss-process=image/auto-orient,1/quality,q_90/watermark,image_bG9nby5wbmc_eC1vc3MtcHJvY2Vzcz1pbWFnZS9yZXNpemUsUF8yMA,g_center,t_50,x_10,y_10

系统会自动生成相关的配置,这些无需理会,但是只有这些,是无法解析的,我们还要手动添加IP地址才可以:

65-28.jpg?x-oss-process=image/auto-orient,1/quality,q_90/watermark,image_bG9nby5wbmc_eC1vc3MtcHJvY2Vzcz1pbWFnZS9yZXNpemUsUF8yMA,g_center,t_50,x_10,y_10

同样找到上面的操作键,选择新建主机:

65-29.jpg?x-oss-process=image/auto-orient,1/quality,q_90/watermark,image_bG9nby5wbmc_eC1vc3MtcHJvY2Vzcz1pbWFnZS9yZXNpemUsUF8yMA,g_center,t_50,x_10,y_10

在弹出的窗口中输入相关的信息。上面是主机名,留空则会使用域名;下面是要解析的IP地址。依次输入后点添加主机:

65-30.jpg?x-oss-process=image/auto-orient,1/quality,q_90/watermark,image_bG9nby5wbmc_eC1vc3MtcHJvY2Vzcz1pbWFnZS9yZXNpemUsUF8yMA,g_center,t_50,x_10,y_10

提示成功创建主机记录:

65-31.jpg?x-oss-process=image/auto-orient,1/quality,q_90/watermark,image_bG9nby5wbmc_eC1vc3MtcHJvY2Vzcz1pbWFnZS9yZXNpemUsUF8yMA,g_center,t_50,x_10,y_10

客户测试

客户端测试图。我们将客户端的DNS服务器地址改为上面提到的DNS服务器的IP,然后通过命令测试解析:

65-32.jpg?x-oss-process=image/auto-orient,1/quality,q_90/watermark,image_bG9nby5wbmc_eC1vc3MtcHJvY2Vzcz1pbWFnZS9yZXNpemUsUF8yMA,g_center,t_50,x_10,y_10


 评论