bind 메인 도메인 이름 서버 설정

1. 네트워크 매개 변수를 설정합니다.
vi/etc/sysconfig/network-scripts/ifcfg-eth0 
DEVICE="eth0"
HWADDR="00:0C:29:68:b1:0f"
NM_CONTROLLED="no"
ONBOOT="yes"
BOOTPROTO=static
IPADDR=192.168.10.95
NETMASK=255.255.255.0
GATEWAY=192.168.10.1
DNS1=202.106.0.20
DNS2=192.168.10.95

:wq
vi/etc/sysconfig/network
NETWORKING=yes
HOSTNAME=ns.linunxyy.cn

:wq
vi/etc/selinux/config 
SELINUX=disabled

:wq
chkconfig NetworkManager off
chkconfig iptables off
chkconfig network on 
vi/etc/hosts
192.168.10.95   ns      ns.linuxyy.cn

:wq
reboot
2. bind 소프트웨어 설치:
vi/etc/yum.repos.d/rhel.repo
[local]
name=local
baseurl=file:///mnt/
enabled=1
gpgcheck=0

:wq
mount/dev/cdrom/mnt
yum -y install bind-*
rpm -qa |grep bind
rpm -ql bind
rpm -ql bind-utils
3. 프로필 수정:
cd/var/named/chroot/etc/
cp/usr/share/doc/bind-9.7.3/sample/etc/named.conf ./
vi named.conf## 다음과 같이 수정하여 붙여넣기를 복사할 수 있습니다.
options
{
        directory               "/var/named";           // "Working" directory
        dump-file               "data/cache_dump.db";
        statistics-file         "data/named_stats.txt";
        memstatistics-file      "data/named_mem_stats.txt";
        listen-on port 53       { 192.168.10.95; };
        query-source port 53;
        allow-query             { 192.168.10.0/24; };
        recursion yes;
};
logging 
{
        channel default_debug {
                file "data/named.run";
                severity dynamic;
        };
};
zone "linuxyy.cn." IN {
                type master;
                file "linuxyy.cn.zone";
};
zone "10.168.192.in-addr.arpa" IN {
                type master;
                file "192.168.10.arpa";
};

:wq
[root@ns etc]# named-checkconf named.conf## 주 프로파일에 오류가 있는지 테스트
cd/var/named/chroot/var/named/
vim linuxyy.cn.zone
$TTL 86400
@       IN SOA  linuxyy.cn. root.linuxyy.cn. (
                                        20171111        ; serial
                                        1D              ; refresh
                                        1H              ; retry
                                        1W              ; expire
                                        3H )            ; minimum
       IN      NS       ns.linuxyy.cn.
ns      IN      A       192.168.10.95
       IN      A       192.168.10.95
       IN      MX 10     mail.linuxyy.cn.
mail     IN      A       192.168.10.95
www     IN      A       192.168.10.96
ftp     IN      CNAME     www

:wq
vim  192.168.10.arpa
$TTL 86400
@       IN SOA  linuxfan.cn. root.linuxyy.cn. (
                                        20171111        ; serial
                                        1D              ; refresh
                                        1H              ; retry
                                        1W              ; expire
                                        3H )            ; minimum
@       IN      NS      ns.linuxyy.cn.
95      IN      PTR     ns.linuxyy.cn.
95      IN      PTR     mail.linuxyy.cn.
96      IN      PTR     www.linuxyy.cn.
96      IN      PTR     ftp.linuxyy.cn.

:wq
[root@ns named]# named-checkzone linuxyy.cn.zone 192.168.10.arpa## 테스트 영역 데이터베이스 프로필
chown named:named linuxyy.cn.zone 192.168.10.arpa ../../etc/named.conf## 권한을 설정하여named 사용자가 읽을 수 있도록 합니다
/etc/init.d/named restart
chkconfig named on
netstat -utpln |grep 53
4. 테스트:
windows/linux:
nslookup
server 192.168.10.95
mail.linuxyy.cn
www.linuxyy.cn
192.168.10.96
exit

좋은 웹페이지 즐겨찾기