DNS的实现实例
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了DNS的实现实例相关的知识,希望对你有一定的参考价值。
[[email protected] ~]# yum -y install bind bind-libs bind-utils [[email protected] ~]# vim /etc/named.conf cat /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 { 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 { 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"; }; zone "hello.com" IN { #添加一个正向zone,记得加分号 type master; file "hello.com"; }; zone "1.10.in-addr.arpa" IN { #添加一个反向zone,记得加分号 type master; file "1.10.hello.com"; }; include "/etc/named.rfc1912.zones"; include "/etc/named.root.key";
[[email protected] named]# cat hello.com 1.10.hello.com $TTL 600 @ IN ns1.hello.com. mail.hello.com. ( 2016110501 2H 10M 1W 1D) @ IN NS ns1.magedu.com. @ IN MX 10 mail.hello.com. ns1 IN A 10.1.19.1 mail IN A 10.1.19.1 www IN A 10.1.19.10 www IN A 10.1.19.11 ftp IN cname files $TTL 6400 @ IN SOA ns1.hello.com. admin.hello.com. ( 2015110501 1H 5M 7D 10M) @ IN NS ns1.hello.com. 1 IN PTR ns1.hello.com. 10 IN PTR www.hello.com. 11 IN PRT www.hello.com. [[email protected] named]# chown named.named magedu.com 1.10.magedu.com
以上是关于DNS的实现实例的主要内容,如果未能解决你的问题,请参考以下文章