[Root @ www named] yum-y install bind // upgrade the package
[Root @ www named] # vim/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;}; // change to any
// Listen-on-v6 port 53 {: 1 ;}; // cancel this line
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 ;}; // change to any
Recursion yes;
Dnssec-enable yes;
Dnssec-validation yes;
Dnssec-lookaside auto;
/* Path to isc dlv key */
Bindkeys-file "/etc/named. iscdlv. key ";
};
Logging {
Channel default_debug {
File "data/named. run ";
Severity dynamic;
};
};
Zone "." IN {
Type hint;
File "named. ca ";
};
Include "/etc/named. rfc1912.zones ";
========================================================== ========================
========================================
[Root @ www named] # vim/etc/named. rfc1912.zones // Add a forward/reverse Region
// Named. rfc1912.zones:
//
// Provided by Red Hat caching-nameserver package
//
// Isc bind named zone configuration for zones recommended
// 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 "localhost. localdomain" IN {
Type master;
File "named. localhost ";
Allow-update {none ;};
};
Zone "localhost" IN {
Type master;
File "named. localhost ";
Allow-update {none ;};
};
// Unregister the blue lines
// Zone "1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa" IN {
// Type master;
// File "named. loopback ";
// Allow-update {none ;};
//};
// Zone "1.0.0.127.in-addr. arpa" IN {
// Type master;
// File "named. loopback ";
// Allow-update {none ;};
///}; // Delete these rows
Zone "0. in-addr.arpa" IN {
Type master;
File "named. empty ";
Allow-update {none ;};
};
// Add positive and reverse
Zone "linuxidc.com" IN {
Type master;
File "linuxidc.com. zone ";
};
Zone "1.168.192.in-addr. arpa" IN {
Type master;
File "1.168.192.zone ";
};
========================================================== ========================================================== ==============
[Root @ www named] # pwd
/Var/named/chroot/var/named
[Root @ www named] #
[Root @ www named] # touch linuxidc.com. zone (create a forward data file)
[Root @ www named] # touch 1.168.192.zone (create reverse data file)
[Root @ www named] # vim linuxidc.com. zone
========================================================== ========================================================== ==============
$ TTL 86400
@ In soa ns.linuxidc.com. root.linuxidc.com .(
42; serial (d. adams)
3 H; refresh
15 M; retry
1 W; expiry
1D); minimum
@ In ns ns.linuxidc.com.
Ns in a 192.168.1.8
Www in a 192.168.1.8
========================================================== ========================================================== ==============
[Root @ www named] # vim 1.168.192.zone
========================================================== ========================================================== ==============
$ TTL 86400
@ In soa ns.linuxidc.com. root.linuxidc.com .(
1997022700; Serial
28800; Refresh
14400; Retry
3600000; Expire
86400); Minimum
@ In ns ns.linuxidc.com.
8 in ptr ns.linuxidc.com.
8 in ptr www.linuxidc.com.
This article from the Linux community website original article link: http://www.linuxidc.com/Linux/2012-08/67145.htm