Experiment environment: VM6.0, RHEL5.0, local YUM source environment is to put MAIL, WWW and other servers together with the DNS server-first check that the system is installed with bind. rpm and caching-nameserver.rpm package [root@www.linuxidc.com ~] # Rpm-qabind * caching-* bind-chroot-9.3.3-7.el5bind-libs-9.3.3-7.el5bi lab environment: VM 6.0, RHEL5.0, local YUM Source
In this environment, servers such as MAIL and WWW are put together with DNS servers.
-First check that the system is installed with the bind. rpm and caching-nameserver.rpm package
Root@www.linuxidc.com ~ # Rpm-qa bind * caching -*
Bind-chroot-9.3.3-7.el5
Bind-libs-9.3.3-7.el5
Bind-9.3.3-7.el5
Bind-libbind-devel-9.3.3-7.el5
Bind-utils-9.3.3-7.el5
Bind-devel-9.3.3-7.el5
Caching-nameserver-9.3.3-7.el5
Bind-sdb-9.3.3-7.el5
Root@www.linuxidc.com ~ #
If not, install these packages.
2. Configure the forward and reverse dns resolution files
Root@www.linuxidc.com ~ # Cd/var/named/chroot/etc/
[Root@www.linuxidc.com etc] # ll
Total 24
-Rw-r -- 1 root 165 Apr 29 localtime
-Rw-r ----- 1 root named 1100 Jan 17 2007 named. caching-nameserver.conf
-Rw-r ----- 1 root named 614 Apr 30 named. rfc1912.zones
-Rw-r -- 1 root named 113 Apr 29 rndc. key
[Root@www.linuxidc.com etc] # cp-p named-caching-nameserver.conf naemed. conf
[Root@www.linuxidc.com etc] # vi named. rfc1912.zones
// 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
//
// See/usr/share/doc/bind */sample/for example named configuration files.
//
Zone "." IN {
Type hint;
File "named. ca ";
};
Zone "linuxidc.com" IN {
Type master;
File "linuxidc.com. zone ";
Allow-update {none ;};
};
Zone "1.168.192.in-addr. arpa" IN {
Type master;
File "linuxidc.com. local ";
Allow-update {none ;};
};
[Root@www.linuxidc.com etc] # vi named. conf
//
// Named. caching-nameserver.conf
//
// Provided by Red Hat caching-nameserver package to configure
// 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.
//
// Do not edit this file-use system-config-bind or an editor
// To create named. conf-edits to this file will be lost on
// Caching-nameserver package upgrade.
//
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 ";
Query-source port 53;
Query-source-v6 port 53;
Allow-query {any ;};
};
Logging {
Channel default_debug {
File "data/named. run ";
Severity dynamic;
};
};
View localhost_resolver {
Match-clients {any ;};
Match-destinations {any ;};
Recursion yes;
Include "/etc/named. rfc1912.zones ";
};
# Yellow indicates the modified part
[Root@www.linuxidc.com etc] #
[Root@www.linuxidc.com etc] # cd/var/named/chroot/var/named/
Check ll as follows:
Drwxrwx --- 2 named 4096 Apr 30 data
-Rw-r ----- 1 root named 198 Jan 17 2007 localdomain. zone
-Rw-r ----- 1 root named 195 Jan 17 2007 localhost. zone
-Rw-r ----- 1 root named 427 Jan 17 2007 named. broadcast
-Rw-r ----- 1 root named 2518 Jan 17 2007 named. ca
-Rw-r ----- 1 root named 424 Jan 17 2007 named. ip6.local
-Rw-r ----- 1 root named 426 Jan 17 2007 named. local
-Rw-r ----- 1 root named 427 Jan 17 2007 named. zero
Drwxrwx --- 2 named 4096 Jul 27 2004 slaves
[Root@www.linuxidc.com named] # cp-p localdomain. zone linuxidc.com. zone (Be sure to add the-p parameter; otherwise, an error will occur later .)
[Root@www.linuxidc.com named] # cp-p named. local linuxidc.com. local
[Root@www.linuxidc.com named] # vi linuxidc.com. local
$ TTL 86400
@ In soa linuxidc.com. root.linuxidc.com .(
1997022700; Serial
28800; Refresh
14400; Retry
3600000; Expire
86400); Minimum
In ns linuxidc.com.
108 in ptr www.linuxidc.com.
108 in ptr mail.linuxidc.com. (reverse emails are optional .)
Forward file:
[Root@www.linuxidc.com named] # vi linuxidc.com. zone
$ TTL 86400
@ In soa linuxidc.com. root (
42; serial (d. adams)
3 H; refresh
15 M; retry
1 W; expiry
1D); minimum
In ns linuxidc.com.
In mx 10 mail.linuxidc.com.
Www in a 192.168.1.108
Mail in a 192.168.1.108
Add your own domain name ip address in/etc/resolv. conf
Nameserver 192.168.1.108
Iii. Start the DNS Service
[Root@www.linuxidc.com named] # service named restart
Stopping named: [OK]
Starting named: [OK]
[Root@www.linuxidc.com named] #
Iv. Test
Nslookup! (ALL tests passed)
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.