Set up the dns server Raiders

  

First download the bind from http://www.isc.org/products/BIND/(version 9.2.2), and unzip the archive as follows.

tar -xzvpf bind-9.2.2rc1.tar.gz

Then, change the directory to the bind source code directory we extracted:

cd bind-9.2.2rc1 Next, su becomes the root user.

We will install bind to the “/usr/local/” directory. If you don't have one, create one:

mkdir /usr/local

bind Use autoconf, so compiling it is easy, as follows:

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

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

make

Approximately 20 minutes, the compilation can be completed. The rest of the work is to install. Do the following:

make install

This also takes a few minutes.

Bind after the installation, bind can not be used immediately, because some configuration files are not configured. We will give some simple configuration as an example.

In a standard installation, there is a named.conf file, a rndc.conf file, and a namedb directory containing the localhost.rev file. We install these to the “/usr/local/etc” directory. If the directory does not exist, create one first:

mkdir /usr/local/etc

Similarly, we also need to create a directory called "namedb";

mkdir /var/namedb

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

options {

directory "/var /namedb" ;; //working directory

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

};

zone "." {type hint;

file "named.root";

};

//Provide loopback address 127.0.0.1 Reverse Address Mapping

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 the examples above and below are actually doing the same thing.

zone "bind.com" {

type master;

file "bind.com.zone";

notify no;

};

The named.root (sometimes called named.ca, which refers to the same thing, everyone's habits are different) contains the current global top-level domain name server address information. The file may become obsolete over time and requires us to update online regularly. Here is the free download of named.root provided by internic, the information of this file is always up to date. Below, we create the localhost.rev file. The file looks like this:

$TTL 3600@ IN SOA user1.bind.com. hostmaster.bind.com.(1 ; Serial ; Increment by one after every change3600 ; Refresh every hour900 ; Retry every 15 minutes3600000 ; Expire 1000 hours3600 ) ; Minimum 1 hourIN NS nameserv1.bind.com.IN NS nameserv2.bind.com.1 IN PTR localhost.

You can also download the localhost.rev file and download it The file is placed in the /var/namedb directory:

mv localhost.rev /var/namedb

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

The following we create the rndc.conf file and use it to supplement the named.conf file. The rndc.conf file can be created automatically by the program. Let's change the directory to /usr/local/etc :

cd /usr/local/etc

Then we use rndc-confgen to generate the configuration file. Due to a bug in Solaris 7, we need to type a bunch of letters to generate the key used by rndc to contact bind (I don't need to type these nasty letters when I install it in Solaris 8). The command format is as follows:

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

Always type until the prompt "stop typing" on the console. This will automatically generate the rndc.conf file. The rndc.conf file also includes some lines that must be added to named.conf. We can automatically add these lines to the named.conf file by the following command tail -n10 rndc.conf |  Head -n9 |  Sed -e s/#\\ //g >;>; named.conf

Now, we are ready to run bind. First we run the command on the console:

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

After some information After that, it will finally show a behavior “running”.

Use the following command:

/usr/local/sbin/rndc status

It will show that our server is already running, 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 the operation of bind and re-configure the configuration file, instead of savagely killing Deal with bind.

Now we can set the dns server to run automatically when it starts, without us having to open a window to run it. We can do a startup file in the “/etc/rc2.d” directory so that bind will start automatically each time the server starts. This work is relatively simple and will not be repeated here.

Copyright © Windows knowledge All Rights Reserved