DNS解析综合学习案例
Posted shinian12138
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了DNS解析综合学习案例相关的知识,希望对你有一定的参考价值。
DNS解析综合学习案例
#图右侧为做题前环境配置
#命令为红色
#命令加载内容为绿色
#vi编辑内容为蓝色
1、用户需把/dev/myvg/mylv逻辑卷以支持磁盘配额的方式挂载到网页目录下
[root@localhost ~]# vi /etc/fstab
/dev/myvg/mylv /usr/local/httpd/htdocs/ xfs defaults,usrquota,grpquota 0 0
[root@localhost ~]# mount -a
2、在网页目录下创建测试文件index.html,内容为用户名称,通过浏览器访问测试
[root@localhost ~]# cd /usr/local/httpd/htdocs/
[root@localhost htdocs]# vi index.html
3、创建用户账户,对LVM配置磁盘配额限制用户磁盘容量为软限制80M;硬限制100M、文件数量软限制为80个;硬限制为100个。
[root@localhost htdocs]# useradd laowang
[root@localhost htdocs]# passwd laowang
[root@localhost ~]# edquota -u laowang /dev/myvg/mylv
Disk quotas for user laowang (uid 1001):
Filesystem blocks soft hard inodes soft hard
/dev/mapper/myvg-mylv 0 81920 102400 0 80 100
[root@localhost ~]# quotaon -auvg
4、构建主从DNS域名解析环境
5、主从DNS都可将www.study.com域名解析为192.168.200.113
6、客户机可通过浏览器访问www.study.com得到WEB服务器相应内容
7、主域名服务器要同时担任缓存域名服务器功能
8、客户机通过nslookup域名测试工具可解析到www.jd.com等网站的域名解析结果
4、5、6、7、8结合在一起做了
主服务器加缓存服务器功能配置
[root@localhost ~]rpm -qa | grep -w bind
bind-libs-lite-9.9.4-50.el7.x86_64
bind-utils-9.9.4-50.el7.x86_64
]bind-license-9.9.4-50.el7.noarch
bind-libs-9.9.4-50.el7.x86_64
[root@localhost ~]# yum -y install bind
[root@localhost ~]# vi /etc/named.conf
options
listen-on port 53 192.168.200.111; ;
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
memstatistics-file "/var/named/data/named_mem_stats.txt";
recursing-file "/var/named/data/named.recursing";
secroots-file "/var/named/data/named.secroots";
allow-query any; ;
recursion yes;
;
zone "." IN
type hint;
file "named.ca";
;
zone "study.com" IN
type master;
file "study.zheng";
allow-transfer 192.168.200.112; ;
;
zone "200.168.192.in-addr.arpa" IN
type master;
file "study.fan";
allow-transfer 192.168.200.112; ;
;
[root@localhost ~]# named-checkconf /etc/named.conf
[root@localhost ~]# cd /var/named/
[root@localhost ~]# cp named.localhost study.zheng
$TTL 1D
@ IN SOA study.com. admin.study.com. (
100 ; serial
1D ; refresh
1H ; retry
1W ; expire
3H ) ; minimum
NS ns1.study.com.
NS ns2.study.com.
MX 10 mail.stydu.com.
mail A 192.168.200.114
www A 192.168.200.113
ns1 A 192.168.200.111
ns2 A 192.168.200.112
[root@localhost ~]# cp study.zheng study.fan
$TTL 1D
@ IN SOA study.com. admin.study.com. (
108 ; serial
1D ; refresh
1H ; retry
1W ; expire
3H ) ; minimum
IN NS ns1.study.com.
IN NS ns2.study.com.
IN MX 10 mail.study.com.
114 IN PTR mail.study.com.
113 IN PTR www.study.com.
111 IN PTR ns1.study.com.
112 IN PTR ns2.study.com.
[root@localhost named]# named-checkzone study.com /var/named/study.zheng
[root@localhost named]# named-checkzone study.com /var/named/study.fan
[root@localhost named]# systemctl restart named
主服务器加缓存服务器功能配置完毕
从服务器配置
[root@localhost ~]rpm -qa | grep -w bind
bind-libs-lite-9.9.4-50.el7.x86_64
bind-utils-9.9.4-50.el7.x86_64
bind-license-9.9.4-50.el7.noarch
bind-libs-9.9.4-50.el7.x86_64
[root@localhost ~]# yum -y install bind
[root@localhost ~]# vi /etc/named.conf
options
directory "/var/named";
;
zone "study.com" IN
type slave;
file "slaves/study.zheng";
masters 192.168.200.111; ;
;
zone "200.168.192.in-addr.arpa" IN
type slave;
file "slaves/study.fan";
masters 192.168.200.111; ;
;
[root@localhost ~]# named-checkconf /etc/named.conf
[root@localhost named]# systemctl restart named
从服务器配置完毕
测试机window7测试(正、反解析,主服务器、从服务器为DNS解析)
以上是关于DNS解析综合学习案例的主要内容,如果未能解决你的问题,请参考以下文章