毕业设计之dns搭建:

Posted linux——quan

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了毕业设计之dns搭建:相关的知识,希望对你有一定的参考价值。

[apps@dns_sever ~]$ sudo yum install -y bind
[apps@dns_sever ~]$ sudo vim /etc/named.conf 
//
// named.conf
//
// Provided by Red Hat bind package to configure the ISC BIND named(8) DNS
// server as a caching only nameserver (as a localhost DNS resolver only).
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//

options {
    listen-on port 53 { 127.0.0.1; any;};
    listen-on-v6 port 53 { ::1; };
    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";
    allow-query     { localhost; any;};
    recursion yes;

    dnssec-enable no;
    dnssec-validation no;

    /* Path to ISC DLV key */
    bindkeys-file "/etc/named.iscdlv.key";

    managed-keys-directory "/var/named/dynamic";
};

logging {
        channel default_debug {
                file "data/named.run";
                severity dynamic;
        };
};

zone "." IN {
    type hint;
    file "named.ca";
};

include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";

注意:上面修改了 加入两个any 

  将dnssec 相关的都设置为no

 

Domain Name System Security Extensions (DNSSEC)DNS安全扩展,是由IETF提供的一系列DNS安全认证的机制

DNSSEC是为解决DNS欺骗和缓存污染而设计的一种安全机制。
由于内网dns,只用于内网的域名解析,所以不用添加

 

修改子配置文件:

 

[root@dnssever.quan.bbs ~]$vim /etc/named.rfc1912.zones 

// (c)2007 R W Franks
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//

zone "localhost.localdomain" IN {
        type master;
        file "named.localhost";
        allow-update { none; };
};

zone "localhost" IN {
        type master;
        file "named.localhost";
        allow-update { none; };
};

zone "1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa" IN {
        type master;
        file "named.loopback";
        allow-update { none; };
};

zone "1.0.0.127.in-addr.arpa" IN {
        type master;
        file "named.loopback";
        allow-update { none; };
};

zone "0.in-addr.arpa" IN {
        type master;
        file "named.empty";
        allow-update { none; };
};


zone "quan.bbs" IN {
        type master;
        file "quan.bbs.zone";
        allow-update { none; };
};

编辑详细的dns解析文件:

[root@dnssever.quan.bbs ~]$vim /var/named/quan.bbs.zone 

$TTL 1D
@       IN SOA  @ rname.invalid. (
                                        0       ; serial
                                        1D      ; refresh
                                        1H      ; retry
                                        1W      ; expire
                                        3H )    ; minimum
@       NS      dns.quan.bbs.
dns     A       192.168.111.222
lvsA.load      A       192.168.111.131
lvsB.load    A       192.168.111.132
webone  A       192.168.111.141
webtwo  A       192.168.111.142
mysql   A       192.168.111.151
mysql.bkone     A       192.168.111.152
mysql.bktwo     A       192.168.111.153
ansz    A       192.168.111.111
jp      A       192.168.111.122
dnsserver       A       192.168.111.222

解析:

zone 通常具有以下几种标志:

SOA:开始验证 (Start of Authority);
NS:名称服务器 (NameServer),后面记录的数据是 DNS 服务器的意思;
A:地址 (Address),后面记录的是 IP 的对应 (最重要)。

 

测试:

[root@dnssever.quan.bbs ~]$yum install bind-utils
[root@dnssever.quan.bbs ~]$vim /etc/resolv.conf

; generated by /sbin/dhclient-script
search localdomain one.bbs
nameserver 192.168.111.222
nameserver 8.8.8.8

检测
[root@dnssever.quan.bbs ~]$nslookup webone.quan.bbs
Server:        192.168.111.222
Address:    192.168.111.222#53

Name:    webone.quan.bbs
Address: 192.168.111.141

 

将其他服务器加上dns服务器即可

注:建议直接再网卡上加dns服务器,按照小范围和大范围设置

 

以上是关于毕业设计之dns搭建:的主要内容,如果未能解决你的问题,请参考以下文章

Linux之DNS服务器搭建及常见DNS攻击和防御

初学者学习Linux之DNS服务搭建

初学者学习Linux之DNS服务搭建

初学者学习Linux之DNS服务搭建

Linux网络服务学习之路——DNS域名系统服务之基础功能实验

Linux之DNS域名系统服务