Set up DNS Raiders

xiaoxiao2021-03-06  68

Author cpss http://cpss.zz.ha.cn

Welcome, but must indicate the source and author name.

Set up DNS Raiders

First download Bind from here (Version 9.2.2), and unconnect the compression package as follows.

Tar -xzvpf bind-9.2.2rc1.tar.gz

Then, change the directory to our decompressed Bind original code directory:

CD BIND-9.2.2RC1

Next, SU is a root user.

We install Bind to the "/ usr / local /" directory. If you don't have this directory, create one:

MKDIR / USR / LOCAL

Bind uses AutoConf, so compiling it is easy, as follows:

./configure --prefix = / usr / local --Mandir = / usr / local / share / man

For a few minutes, the file is configured. Then the following:

Make

About 20 minutes, compilation work can be done. The rest of the work is installation (INSTALL). Take the following:

Make Install

This also takes a few minutes.

When the installation is complete, Bind does not use it immediately because there are still some configuration files that are not configured. We will give some simple configuration as an example.

At standard installation, there is a named.conf file, an rndc.conf file, and a namedb directory, which contains the localhost.rev file. We installed these to the "/ usr / local / etc" directory. If the directory does not exist, create one:

MKDIR / USR / LOCAL / ETC

Similarly, we also need to create a "nameDB" directory:

MKDIR / VAR / NAMEDB

Now we edit the "named.conf" file. We can add more content in the future, but now it looks like this (we can download the named.conf file from here):

Options {

Directory "/ var / namedb"; // Working Catalog

Pid-file "named.pid"; // put the PID file to the working directory, otherwise the PID file is in / var / run directory

}

"." {

Type hint;

File "named.root";

}

// Provide a reverse address map of Loopback Address 127.0.0.0.1

Zone "0.0.127.in-addr.Arpa" {

TYPE MASTER;

File "localhost.rev"; notify no;

Zone "173.76.207.in-addr.Arpa" in {Type Master; File "DB.207.76.173"; Notify NO;

// Note that different examples of the above and the following forms are actually completed as the same function.

Zone "bind.com" {

TYPE MASTER;

File "bind.com.zone";

NOTIFY NO;

}

Among them, Named.Root (sometimes known as Named.ca, all the same thing, everyone's habits are all included in the current global top domain name server address information, which may be over time It has become outdated, and we need to go online regularly. Here is the free downloaded named.root provided by INTERNIC, which is always the latest.

Below, we create a localhost.rev file. This file looks like this: $ TTL 3600

@ In SOA User1.bind.com. Hostmaster.bind.com.

(

1; Serial; Increment by One After Every Change

3600; Refresh Every Hour

900; Retry Every 15 minutes

3600000; EXPIRE 1000 Hours

3600); Minimum 1 HOUR

IN ns nameserv1.bind.com.

IN ns nameserv2.bind.com.

1 in ptr localhost.

You can also download the localhost.rev file and place the downloaded file into the / var / namedb directory:

mv localhost.rev / var / namedb

You can also download an instance of an address resolution file, and learn from the analysis instance.

Below we create rndc.conf files and use it to add named.conf files. RNDC.CONF files can be created automatically via the program. Let's change the directory to / usr / local / etc:

CD / USR / local / etc

Then we use RNDC-ConfGen to generate this profile. Due to a bug of Solaris 7, we need to type a stack of letters to generate the RNDC Contact BIND (I installed these annoyed letters when I installed in Solaris 8). The command format is as follows:

/ usr / local / sbin / rndc-confgen> rndc.conf

Ted to "Stop Typing" until the CONSOLE is prompted. This will automatically generate the rndc.conf file. RNDC.CONF files also include some rows that must be added to Named.conf. We can automatically add these travel to the named.conf file by the following command:

Tail -n10 rndc.conf | Head -n9 | sed -e s / # / // g >> Named.conf

Now we can prepare to run bind. First we first run on the console:

/ usr / local / sbin / named -gc /usr/local/etc/named.conf &

After some information appears, a behavior "Running" will be finally displayed.

Use the following command:

/ usr / local / sbin / rndc status

It will display our server has been run, as shown below:

Number of Zones: 5

Debug Level: 0

XFERS RUNNING: 0

XFERS DeferRed: 0

SOA Queries in Progress: 0

Query Logging is Off

Server is Up and Running

After BIND is started, we can use rNDC to control Bind's run, reconfigure files, and no longer need brutal to deal with bac.

Now we can use the DNS server to start automatically, do not need us to open a window to run it. We can make a startup file in the "/etc/rc2.d" directory so that BIND will start automatically each server startup. This work is relatively simple, and it will not be described here.

appendix:

EXAMPLE OF Named.conf

Example of db.207.76.173

EXAMPLE of localhost.rev

Example of bind.com.zonecurrent named.root

Reference:

bind

Official website information

转载请注明原文地址:https://www.9cbs.com/read-106532.html

New Post(0)