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

[service Building] bind forward and backward configuration master-slave configuration subdomain configuration basic security settings

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

Experimental environment

System hostname IP comment

Centos6.8 nod1.wupeng.com 10.208.131.222 main server

Centos6.8 nod2.wupeng.com 10.208.131.228 slave server

Centos6.8 nod3.wupeng.com 10.208.131.229 subdomain server

Bind package:

Bind: provided dns server programs, as well as several commonly used test programs

Bind-libs: library files commonly used by programs in the bind and bind-utils packages

Bind-utils:bind client assemblies, such as dig, host, nslookup, etc.

Bind-chroot: optional, let named run in jail mode

Change the hostname of the three hosts to turn off the firewall and turn off selinux (restart the service is required after iptables and selinux save the configuration)

Nod1 change host

[root@nod1 ~] # vim / etc/sysconfig/network NETWORKING=yesHOSTNAME=nod1.wupeng.com

Nod2 change host

[root@nod2 ~] # vim / etc/sysconfig/network NETWORKING=yesHOSTNAME=nod2.wupeng.com

Nod3 change host

[root@nod3 ~] # vim / etc/sysconfig/network NETWORKING=yesHOSTNAME=nod3.wupeng.com

Nod1 clears firewall rules

[root@nod1 ~] # iptables-F [root@nod1 ~] # service iptables save

Nod2 clears firewall rules

[root@nod2 ~] # iptables-F [root@nod2 ~] # service iptables save

Nod3 clears firewall rules

[root@nod3 ~] # iptables-F [root@nod3 ~] # service iptables save

Nod1 shuts down selinux security mechanism

[root@nod1 ~] # vim / etc/sysconfig/selinux or vim / etc/selinux/configSELINUX=disabled

Nod2 shuts down selinux security mechanism

[root@nod2 ~] # vim / etc/sysconfig/selinux or vim / etc/selinux/configSELINUX=disabled

Nod3 shuts down selinux security mechanism

[root@nod3 ~] # vim / etc/sysconfig/selinux or vim / etc/selinux/configSELINUX=disabled

The synchronization time of the three hosts is the same. You can use the ntpdate command to synchronize the time.

[root@nod1 ~] # yum install ntpdate-y

[root@nod2 ~] # yum install ntpdate-y

[root@nod3 ~] # yum install ntpdate-y

[root@nod1 ~] # ntpdate ntp.api.bz

28 Jun 15:42:08 ntpdate [1598]: step time server 17.253.84.125 offset 856096.191423 sec

[root@nod2 ~] # ntpdate ntp.api.bz

28 Jun 15:42:08 ntpdate [1577]: step time server 17.253.84.125 offset 854843.947376 sec

[root@nod3 ~] # ntpdate ntp.api.bz

28 Jun 15:42:08 ntpdate [1593]: step time server 17.253.84.125 offset 599540.432080 sec

Forward configuration

Install bind related software on the nod1 host

[root@nod1 ~] # yum install bind bind-utils-y / / bind-libs this library file will be installed dependently

Edit / etc/bind.conf main configuration file

[root@nod1 ~] # vim / etc/named.conf

Options {listen-on port 53 {127.0.0.1; 10.208.131.222;}; / / listening address / / 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"; allow-query {any;}; / / the request method allowed is owner recursion yes; dnssec-enable no; / / the security mechanism is NO dnssec-validation no / / the security mechanism is NO / * Path to ISC DLV key * / bindkeys-file "/ etc/named.iscdlv.key"; managed-keys-directory "/ var/named/dynamic";}

Edit / etc/named.rfc1912.zones to create a forward zone file

[root@nod1 ~] # vim / etc/named.rfc1912.zones

Zone "wupeng.com" IN {type master; file "wupeng.com.zone";}

Use the template to create a zone data file in the wupeng.com domain with permissions of 640 genera and named

[root@nod1 ~] # cd / var/named/

First: [root@nod1 named] # cp-p named.localhost wupeng.com.zone second: [root@nod1 named] # cp-rf named.localhost wupeng.com.zone [root@nod1 named] # chmod 640 wupeng.com.zone [root@nod1 named] # chgrp named wupeng.com.zone

View file properties

[root@nod1 named] # ll wupeng.com.zone-rw-r- 1 root named 152 June 21 2007 wupeng.com.zone

Edit wupeng.com.zone file records NS and A records

[root@nod1 named] # vim wupeng.com.zone

$TTL 1D$ORIGIN wupeng.com.@ IN SOA ns1.wupeng.com. Admin.wupeng.com. (2017062800; serial 1D; refresh 1H; retry 1W Expire 3H); minimum IN NS ns1.wupeng.com.ns1 IN A 10.208.131.222www IN A 10.208.131.223

Detect whether there are errors in the main configuration file and zone data file

[root@nod1 named] # named-checkconf / / correct without any hint [root@nod1 named] # named-checkzone wupeng.com/ var/named/wupeng.com.zone zone wupeng.com/IN: loaded serial 2017062800OK

Start the bind service and test if forward parsing is successful

[root@nod1 named] # service named start

Generating / etc/rndc.key: [OK]

Start named: [OK]

Test:

[root@nod1 named] # dig-t A www.wupeng.com @ 10.208.131.222

; DiG 9.8.2rc1-RedHat-9.8.2-0.62.rc1.el6_9.2-t A www.wupeng.com @ 10.208.131.222

;; global options: + cmd

;; Got answer:

;;-> > HEADERHEADERHEADERHEADERHEADERHEADERHEADERHEADER

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