CentOS6.5下配置DNS过程

centos 6.5下配置DNS过程

十多年的三元网站建设经验,针对设计、前端、开发、售后、文案、推广等六对一服务,响应快,48小时及时工作处理。网络营销推广的优势是能够根据用户设备显示端的尺寸不同,自动调整三元建站的显示方式,使网站能够适用不同显示终端,在浏览器中调整网站的宽度,无论在任何一种浏览器上浏览网站,都能展现优雅布局与设计,从而大程度地提升浏览体验。创新互联从事“三元网站设计”,“三元网站推广”以来,每个客户项目都认真落实执行。

安装bind

# mount -o loop /root/Downloads/CentOS-6.5-x86_64-bin-DVD1.iso /mnt/DVD
# cd /mnt/DVD
# cd Packages
# ll | grep bind
-r--r--r-- 2 root root 4171112 Aug 28 2013 bind-9.8.2-0.17.rc1.el6_4.6.x86_64.rpm
-r--r--r-- 2 root root 72520 Aug 28 2013 bind-chroot-9.8.2-0.17.rc1.el6_4.6.x86_64.rpm
-r--r--r-- 2 root root 70696 Nov 25 2013 bind-dyndb-ldap-2.3-5.el6.x86_64.rpm
-r--r--r-- 2 root root 910676 Aug 28 2013 bind-libs-9.8.2-0.17.rc1.el6_4.6.i686.rpm
-r--r--r-- 2 root root 899540 Aug 28 2013 bind-libs-9.8.2-0.17.rc1.el6_4.6.x86_64.rpm
-r--r--r-- 2 root root 186584 Aug 28 2013 bind-utils-9.8.2-0.17.rc1.el6_4.6.x86_64.rpm
# rpm -ivh bind-9.8.2-0.17.rc1.el6_4.6.x86_64.rpm
# rpm -ivh bind-chroot-9.8.2-0.17.rc1.el6_4.6.x86_64.rpm

• 配置named.conf

key "rndc-key" {
algorithm hmac-md5;
secret "4Re7AAqoTeAWNLyZUyD1sQ==";
};

controls {
inet 127.0.0.1 port 953
allow { 127.0.0.1; } keys { "rndc-key"; };
};

options
{
// Put files that named is allowed to write in the data/ directory:
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 { any; };
listen-on port 53 { any; };

//listen-on-v6 port 53 { any; };
listen-on-v6 port 53 { ::1; };

allow-query { any; };
allow-query-cache { any; };

// Enable/disable recursion - recursion yes/no;
recursion yes;
dnssec-enable yes;
dnssec-validation yes;
dnssec-lookaside auto;

bindkeys-file "/etc/named.iscdlv.key";

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

};

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

view "localhost_resolver"
{
match-clients { any; };
match-destinations { any; };
recursion yes;

# all views must contain the root hints zone:
zone "." IN {
type hint;
//file "/var/named/named.ca";
file "/dev/null";
};
include "/etc/named.rfc1912.zones";
};

• 配置zone:named.rfc1912.zones,包括正向解析和反向解析

// named.rfc1912.zones:
//
// Provided by Red Hat caching-nameserver package
//
// ISC BIND named zone configuration for zones recommended by
// RFC 1912 section 4.1 : localhost TLDs and address zones
// and http://www.ietf.org/internet-drafts/draft-ietf-dnsop-default-local-zones-02.txt
// (c)2007 R W Franks
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//

zone "Oracle.test" IN {
type master;
file "oracle.test.zone";
allow-update { none; };
};

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

正向解析文件:

# cat oracle.test.zone
$TTL 86400
@ IN SOA ns.oracle.test. root.oracle.test. (
42 ; serial
3H ; refresh
15M ; retry
1W ; expire
1D ) ; minimum
IN NS ns.oracle.test.
ns IN A 192.168.17.240
node1 IN A 192.168.17.235
node2 IN A 192.168.17.236
node1-vip IN A 192.168.17.237
node2-vip IN A 192.168.17.238
node-scan IN A 192.168.17.239

反向解析文件:

# cat 17.168.192.zone
$TTL 86400
@ IN SOA ns.oracle.test. root.oracle.test. (
1997022700 ; serial
28800 ; refresh
14400 ; retry
3600000 ; expire
86400 ) ; minimum

IN NS ns.oracle.test.
240 IN PTR ns.oracle.test.
235 IN PTR node1.oracle.test.
236 IN PTR node2.oracle.test.
237 IN PTR node1-vip.oracle.test.
238 IN PTR node2-vip.oracle.test.
239 IN PTR node-scan.oracle.test.
配置完控制文件后还要记得生成rndc-key,这里就不再赘述了。
都完成后便可以重启named服务并检查配置了:

# service named restart
# service named status
# nslookup node1
Server: 192.168.17.240
Address: 192.168.17.240#53

Name: node1.oracle.test
Address: 192.168.17.235

当前题目:CentOS6.5下配置DNS过程
当前URL:http://www.shufengxianlan.com/qtweb/news10/483760.html

网站建设、网络推广公司-创新互联,是专注品牌与效果的网站制作,网络营销seo公司;服务项目有等

广告

声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 创新互联