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

How to install and configure the DNS server

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

Share

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

This article is about how to install and configure the DNS server. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

# # hostname hadoop4 IP 192.168.0.106 as the DNS server # # install the corresponding software package for bind: [root@hadoop4 ~] # yum-y install bind bind-utils bind-chroot## check whether to install bind: [root@hadoop4 ~] # rpm-qa | grep'^ bind'bind-chroot-9.8.2-0.30.rc1.el6_6.2.x86_64bind-9.8.2-0.30.rc1.el6_6 .2.x86 _ 64bind-libs-9.8.2-0.30.rc1.el6_6.2.x86_64bind-utils-9.8.2-0.30.rc1.el6_6.2.x86_64## modification / etc/named.conf [root@hadoop4 ~] # vim / etc/named.conflisten-on port 53 {any }; / / change the original 127.0.0.1 to anyallow-query {any;}; / / change the original localhost to any##, modify / etc/named.rfc1912.zones, and add two zone to the end of the / etc/named.rfc1912.zones file (which can also be written directly in named.conf) [root@hadoop4 ~] # vim / etc/named.rfc1912.zoneszone "hadoop.com" IN {type master; file "named.hadoop.com" Allow-update {none;}; zone "0.168.192.in-addr.arpa" IN {type master; file "named.192.168.0.zone"; allow-update {none;};} # # configure the forward parsing file [root@hadoop4 ~] # cd / var/named [root@hadoop4 named] # cp-p named.localhost named.hadoop.com [root@hadoop4 named] # vim named.hadoop.com$TTL 1D @ IN SOA hadoop4.hadoop.com. Grid.hadoop4.hadoop.com. (0; serial 1D; refresh 1H; retry 1W; expire 3H) Minimum@ IN NS hadoop4.hadoop.com.hadoop4.hadoop.com. IN A 192.168.0.106hadoop5.hadoop.com. IN A 192.168.0.107hadoop6.hadoop.com. IN A 192.168.0.108 configuration reverse resolution file [root@hadoop4 ~] # cd / var/named [root@hadoop4 named] # cp-p named.localhost named.192.168.0.zone [root@hadoop4 named] # vim named.192.168.0.zone$TTL 1D @ IN SOA hadoop4.hadoop.com. Grid.hadoop4.hadoop.com. (0; serial 1D; refresh 1H; retry 1W; expire 3H) Minimum@ IN NS hadoop4.hadoop.com.106 IN PTR hadoop4.hadoop.com.107 IN PTR hadoop5.hadoop.com.108 IN PTR hadoop6.hadoop.com.## add DNS Domain name Server ip Add the server ip address [root@hadoop4 ~] # vim / etc/sysconfig/network-scripts/ifcfg-eth0DEVICE=eth0HWADDR=08:00:27:26:b8:c1TYPE=EthernetUUID=dabd3173-5f69-454c-aa97-5cc2a09dfba0ONBOOT=yesNM_CONTROLLED=yes#BOOTPROTO=dhcpBOOTPROTO=staticBROADCAST=192.168.0.255IPADDR=192.168.0.106NETMASK=255.255.255.0GATEWAY=192.168.0.1DNS1=192.168.0.106 [root@hadoop4 ~] # service network restart## to start DNS [root] in the / etc/sysconfig/network-scripts/ifcfg-eth0 file of each node @ hadoop4 ~] # service named start startup named: [OK] # # set boot [root@hadoop4 ~] # chkconfig named on## check log to confirm whether the DNS service is normal [root@hadoop4 ~] # tail-n 30 / var/log/messages | grep namedApr 26 13:48:11 hadoop4 named [5443]: sizing zone task pool based on 8 zonesApr 26 13:48: 11 hadoop4 named [5443]: using built-in DLV key for view _ defaultApr 26 13:48:11 hadoop4 named [5443]: set up managed keys zone for view _ default File'/ var/named/dynamic/managed-keys.bind'Apr 26 13:48:11 hadoop4 named [5443]: Warning: 'empty-zones-enable/disable-empty-zone' not set: disabling RFC 1918 empty zonesApr 26 13:48:11 hadoop4 named [5443]: automatic empty zone: 127.IN-ADDR.ARPAApr 26 13:48:11 hadoop4 named [5443]: automatic empty zone: 254.169.IN-ADDR.ARPAApr 26 13:48:11 hadoop4 named [5443]: automatic empty zone: 2.0. 192.IN-ADDR.ARPAApr 26 13:48:11 hadoop4 named [5443]: automatic empty zone: 100.51.198.IN-ADDR.ARPAApr 26 13:48:11 hadoop4 named [5443]: automatic empty zone: 113.0.203.IN-ADDR.ARPAApr 26 13:48:11 hadoop4 named [5443]: automatic empty zone: 255.255.255.255.IN-ADDR.ARPAApr 26 13:48:11 hadoop4 named [5443]: automatic empty zone: 0.0.0.0.0.0.0. 0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.IP6.ARPAApr 26 13:48:11 hadoop4 named [5443]: automatic empty zone: D.F.IP6.ARPAApr 26 13:48:11 hadoop4 named [5443]: automatic empty zone: 8.E.F.IP6.ARPAApr 26 13:48:11 hadoop4 named [5443]: automatic empty zone: 9.E .F.IP6.ARPAApr 26 13:48:11 hadoop4 named [5443]: automatic empty zone: A.E.F.IP6.ARPAApr 26 13:48:11 hadoop4 named [5443]: automatic empty zone: B.E.F.IP6.ARPAApr 26 13:48:11 hadoop4 named [5443]: automatic empty zone: 8.B.D.0.1.0.0.2.IP6.ARPAApr 26 13:48:11 hadoop4 named [5443]: command channel listening on 127.0.0.1#953Apr 26 13:48 : 11 hadoop4 named [5443]: command channel listening on:: 1#953Apr 26 13:48:11 hadoop4 named [5443]: zone 0.in-addr.arpa/IN: loaded serial 0Apr 26 13:48:11 hadoop4 named [5443]: zone 1.0.0.127.in-addr.arpa/IN: loaded serial 0Apr 26 13:48:11 hadoop4 named [5443]: zone 0.168.192.in-addr.arpa/IN: loaded serial 0Apr 26 13:48:11 hadoop4 named [5443]: zone 1. 0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa/IN: loaded serial 0Apr 26 13:48:11 hadoop4 named [5443]: zone hadoop.com/IN: loaded serial 0Apr 26 13:48:11 hadoop4 named [5443]: zone localhost.localdomain/IN: loaded serial 0Apr 26 13:48: 11 hadoop4 named [5443]: zone localhost/IN: loaded serial 0Apr 26 13:48:11 hadoop4 named [5443]: managed-keys-zone. / IN: loaded serial 3Apr 26 13:48:11 hadoop4 named [5443]: runningApr 26 13:48:11 hadoop4 named [5443]: zone hadoop.com/IN: sending notifies (serial 0) Apr 26 13:48:11 hadoop4 named [5443]: zone 0.168.192.in-addr.arpa/IN: sending notifies (serial 0) # # Verification Test [root @ hadoop4 ~] # nslookup hadoop4.hadoop.comServer: 192.168.0.106Address: 192.168.0.106#53Name: hadoop4.hadoop.comAddress: 192.168.0.106 [root@hadoop4 ~] # nslookup 192.168.0.107Server: 192.168.0.106Address: 192.168.0.106#53107.0.168.192.in-addr.arpa name = hadoop5.hadoop.com.

Since I only set the hostname (hostname) but not the domain name (domainname) in my experimental environment, I changed some settings to achieve the goal of only parsing hostname.

[root@hadoop4 ~] # cat / etc/named.rfc1912.zoneszone "." IN {type master; file "named.hadoop.com"; allow-update {none;};}; zone "0.168.192.in-addr.arpa" IN {type master; file "named.192.168.0.zone"; allow-update {none;};}; [root@hadoop4 ~] # cat / var/named/named.hadoop.com$TTL 1D @ IN SOA hadoop4. Grid.hadoop4. (0; serial 1D; refresh 1H; retry 1W; expire 3H) Minimum@ IN NS hadoop4.hadoop4 IN A 192.168.0.106hadoop5 IN A 192.168.0.107hadoop6 IN A 192.168.0.108 [root@hadoop4 ~] # cat / var/named/named.192.168.0.zone$TTL 1D @ IN SOA hadoop4. Grid.hadoop4. (0; serial 1D; refresh 1H; retry 1W; expire 3H) Minimum@ IN NS hadoop4.106 IN PTR hadoop4.107 IN PTR hadoop5.108 IN PTR hadoop6. [root@hadoop4 ~] # nslookup hadoop6Server: 192.168.0.106Address: 192.168.0.106#53Name: hadoop6Address: 192.168.0.108 [root@hadoop4] # nslookup 192.168.0.107Server: 192.168.0.106Address: 192.168.0.10653 107.0.168. 192.in-addr.arpa name = hadoop5. Thank you for reading! This is the end of the article on "how to install and configure the DNS server". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!

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