Linux Red hat 5 DNS server (I) domain name cache server, hatdns

Source: Internet
Author: User
Tags domain name server domain server nameserver nslookup nslookup tool

Linux Red hat 5 DNS server (I) domain name cache server, hatdns
Detailed setup of multiple experiments on Linux Red hat 5 DNS server

Required software packages:

› Bind-9.3.3-7.el5.i386.rpm

› Provide main programs and related documents

› Bind-utils-9.3.3-7.el5.i386.rpm

› Provides dns server testing tools (such as nslookup and dig)

› Bind-chroot-9.3.3-7.el5.i386.rpm

› Provide a disguised root directory to enhance its security (var/named/chroot /)

› Caching-nameserver-9.3.3-7.el5.i386.rpm

› Provide necessary default configuration files for BIND as the cache Domain Name Server

Environment:

The network environment of vmwarevm red hat 1 and red hat 2 is set to bridge mode to ensure that the ip addresses obtained by the virtual machine can communicate with the host.

Domain name cache server

After the package is installed, use the wim editor to edit the/var/named/chroot/etc/named. caching-nameserver.conf file with the following modifications:

Options {\ global configuration

Listen-on port 53 {192.168.11.114 ;};\\ modify your ip address here

Listen-on-v6 port 53 {: 1 ;};\\ ipv6 is not discussed here

Directory "/var/named"; \ default database storage location

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"; \ some statistics

// Those options shocould be used carefully because they disable port

// Randomization

// Query-source port 53;

// Query-source-v6 port 53;

Allow-query {any ;};\\ which clients are allowed to query, and any indicates all

Forward only; \ indicates that the server only performs forwarding queries.

Forwarders {\ The dns address forwarded

114.114.114.114;

223.5.5.5;

};

};

You do not need to care about the following logging {\

Channel default_debug {

File "data/named. run ";

Severity dynamic;

};

};

Save and exit. Use the/etc/init. d/named restart name to restart the dns service to make it take effect.

OK. The domain name cache server is successfully set up. Now let's set the dns address as the Virtual Machine address on the local machine.

Master/Slave Mode primary domain settings:

Generally, when I set up a DNS server, I need to set up two DNS servers to provide uninterrupted DNS query services. One is the master Domain Server and the other is the slave Domain Server. The Slave server itself does not have databases and relies on the master server for synchronous transmission. The settings are as follows:

Because you do not have a cache server, delete these two items globally.

Forward only; \ indicates that the server only performs forwarding queries.

Forwarders {\ The dns address forwarded

114.114.114.114;

223.5.5.5;

};

Vim/var/named/chroot/etc/named. rfc1912.zones

Edit the setting domain of this file and add the following domain to the file:

Zone "wjlmz. vv" IN {

Type master;

File "wjlmz. vv. zone"; \ domain database file, defined by yourself. You need to create a new

Allow-transfer {192.168.11.117 ;};

};

Enter/var/named/chroot/var/named/copy a sample file and perform modification. Note that-p is added to cp to keep the original permission settings, of course, if you create a new file, you can also use the chmod command to modify the permission. The command is as follows:

Cp-p localhost. zone wjlmz. vv. zone \ Name Defined in the primary domain

Modify the wjlmz. vv. zone file in the editor as follows:

$ TTL 6400

@ In soa wjlmz. vv. root (\ note that vv is followed by a point. The root here refers to the mailbox

2014111101; serial (d. adams) \ 2014111101 serial number, which can be customized and used for synchronization with the slave server. Here I am referring to the first modification on January 11,. Note that this is very important, each modification must be at least + 1 or the Master/Slave node cannot be synchronized.

3 H; refresh

15 M; retry

1 W; expiry

1D); minimum

In ns @

Www in a 192.168.11.114

In aaaa: 1

Wjlmz. vv. in a 192.168.11.114 \ pay attention to the following points

OK save and restart the named service/etc/init. d/named restart

Analysis after setting dns for the test host, use nslookup Tool

Www. wjlmz. vv successfully 192.168.11.114

Wjlmz. vv successfully 192.168.11.114

Build a slave server:

The ip address of the Slave server is 192.168.11.117 specified in named. rfc1912.zones.

In addition to the ip address, the global configuration is the same as that of the master server (master. /Named. caching-nameserver.conf

Domain file configurations are similar, and you need to create a new domain

Modify the named. rfc1912.zones file as follows:

Zone "wjlmz. vv" IN {

Type slave; \ here is set

File "slave/wjlmz. vv. zone"; \ domain database file, defined by yourself. You need to create a new

Masters {192.168.11.114 ;};\\ sets the ip address of the master server

};

OK, start the service/etc/init. d/named restart

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.