Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

CentOS 7.2Building DNS

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Download bind from ISC's official website www.isc.org

Note that there are three versions to choose from: early development version (Early Deployment), stable version (Current-Stable), stable version with extended features (Current-Stable, ESV). If there is no special need, stable version is recommended. The latest version is 9.10.6.

Download the source package: bind-9.10.6.tar.gz

Extract and enter the bind-9.10.6 directory

Compile and install. / configure-- enable-largefile-- enable-threads-- bindir=/bin-- sbindir=/sbin

Make & & make install

If there is no configuration file at the time of compilation and installation, you need to create it yourself.

The configuration file of vim / etc/named.conf bind is under / etc by default, and the file name is named.conf.

Options {

Directory "/ var/named"; # data file location

Pid-file "named.pid"

Recursive-clients 100000000; # how many user queries are run

Version "What do u wanna?"; # masked version

Allow-query {any;}; # run all user queries

Recursion yes; # uses recursive queries

# forward only

# forwarders {219.141.136.10;}

}

Key "rndc-key" {

Algorithm hmac-md5

Secret "RE4+Tk2AUXDjs2ns4Zox8w=="

}

Controls {

Inet 127.0.0.1 port 953

Allow {127.0.0.1;} keys {"rndc-key";}

}

Logging {

Channel query_log {

File "query.log" versions 3 size 20m

Severity info

Print-time yes

Print-category yes

}

Category queries {

Query_log

}

Category edns-disabled {null;}

Category lame-servers {null;}

}

Zone "." IN {

Type hint

File "named.ca"

}

Zone "localhost" IN {

Type master

File "localhost.zone"

Allow-update {none;}

}

Zone "0.0.127.in-addr.arpa" IN {

Type master

File "named.local"

Allow-update {none;}

}

# include "/ var/named/ws.conf"

The configuration in red is generated by the rndc-confgen command and then pasted into the configuration file.

But it takes a long time to generate directly, so you can use rndc-confgen-r / dev/urandom to speed up, or install rng-tools (yum install rng-tools) and start (systemctl start rngd.service) before executing rndc-confgen.

The result generated by rndc-confgen is divided into two parts, and the upper part needs to be written in / etc/rndc.conf (does not exist by default)

Create a new named directory under / var and enter

Generate 3 files: localhost.zone named.ca named.local

Named.ca is the address of the root domain name server

Forward parsing record of localhost.zone localhost

Reverse parsing record of named.local localhost

Named.ca is obtained through dig 8.8.8.8 > named.ca

PS: now it seems that you can only get one a.root-servers.net result. Before, you could get all 13 results.

Localhost.zone

$TTL 86400

$ORIGIN localhost.

@ 1D IN SOA @ root (

42; serial (d. Adams)

3H; refresh

15m; retry

1W; expiry

1D); minimum

1D IN NS @

1D IN A 127.0.0.1

Named.local

$TTL 86400

@ IN SOA localhost. Root.localhost. (

2012062001; Serial

28800; Refresh

14400; Retry

3600000; Expire

86400); Minimum

IN NS localhost.

1 IN PTR localhost.

After the configuration is complete, you can start DNS through the named command. If there are any errors, you can check what errors are reported through named- g, check whether there are syntax errors in named.conf through named-checkconf, and check whether there are syntax errors in the data files by named-checkzone.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report