bind 安装

修改配置文件

/etc/named.conf

listen-on port 53 { any; };

memstatistics-file "/var/named/data/named_mem_stats.txt";

allow-query     { any; };


修改域名文件

/etc/named.rfc1912.zones

 

zone    "dblinux.com"   IN {

        type    master;

        file    "dblinux.com.zone";

};

 

zone    "3.168.192.in-addr.arpa"        IN {

        type master;

        file "named.192.168.3";

};




添加域名ip映射关系

/var/named/dblinux.com.zone

权限修改

chown root:named dblinux.com.zone


 

$TTL 3H

@       IN SOA  dblinux.com root.localhost.com. (

                                        0

                                        1D

                                        1H

                                        1W

                                        3H )

@               IN      NS      ns1.dblinux.com.

ns1             IN      A       192.168.3.121

cos1            IN      A       192.168.3.121

cos2            IN      A       192.168.3.122

cos3            IN      A       192.168.3.123

cos4            IN      A       192.168.3.111

cos5            IN      A       192.168.3.112

cos6            IN      A       192.168.3.113

 

 

 

/var/named/named.192.168.3

chown root:named named.192.168.16

 

$TTL 1D

@       IN SOA dblinux.com root.localhost.com. (

                                        0       ; serial

                                        1D      ; refresh

                                        1H      ; retry

                                        1W      ; expire

                                        3H )    ; minimum

@       IN      NS      ns1.dblinux.com.

121     IN      PTR     cos1.dblinux.com.

122     IN      PTR     cos2.dblinux.com.

123     IN      PTR     cos3.dblinux.com.

111     IN      PTR     cos4.dblinux.com.

112     IN      PTR     cos5.dblinux.com.

113     IN      PTR     cos6.dblinux.com.

 

named service

/usr/lib/systemd/system/named.service

[Unit]

Description=Berkeley Internet Name Domain (DNS)

Wants=nss-lookup.target

Wants=named-setup-rndc.service

Before=nss-lookup.target

After=network.target

After=named-setup-rndc.service

 

[Service]

Type=forking

EnvironmentFile=-/etc/sysconfig/named

Environment=KRB5_KTNAME=/etc/named.keytab

PIDFile=/run/named/named.pid

 

ExecStartPre=/bin/bash -c 'if [ ! "$DISABLE_ZONE_CHECKING" == "yes" ]; then /usr/sbin/named-checkconf -z /etc/named.conf; else echo "Checking of zone files is disabled"; fi'

ExecStart=/usr/sbin/named -u named $OPTIONS

 

ExecReload=/bin/sh -c '/usr/sbin/rndc reload > /dev/null 2>&1 || /bin/kill -HUP $MAINPID'

 

ExecStop=/bin/sh -c '/usr/sbin/rndc stop > /dev/null 2>&1 || /bin/kill -TERM $MAINPID'

 

PrivateTmp=true

 

[Install]

WantedBy=multi-user.target

 

 

 

 

name 重启

systemctl status named.service

systemctl restart named.service

 

阅读更多
个人分类: linux
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

关闭
关闭
关闭