[[Email protected] ~]# yum -y install bind bind-libs bind-utils[[email protected] ~]# vim /etc/named.confcat /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; }; #修改的地方, comment out the line listen-on-v6 port 53 { ::1; };d irectory "/ Var/named ";d ump-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; #允许本地客户端查询, should be written on 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 { #Add a positive zone and remember to include a semicolon type master; file "hello.com"; }; zone " 1.10.in-addr.arpa " IN { #添加一个反向zone, remember to add a semicolon 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. (20161105012h10m1w1d) @ in NS ns1.magedu.com.@ in MX ten mail.hello.com.ns1 in a 10.1.19.1mail in a 10.1.1 9.1www in a 10.1.19.10www in a 10.1.19.11ftp in CNAME Files$ttl 6400@ in SOA ns1.hello.com. Admin.hello.com. (20151105011h5m7d10m) @ in NS ns1.hello.com.1 in ptr ns1.hello.com.10 in ptr www.hello.com.11 in PRT www.h ello.com. [email protected] named]# chown named.named magedu.com 1.10.magedu.com
Examples of DNS implementations