Yum installs DNS software:
[Email protected] ~]# yum-y instal bind Bind-chroot
Configuration:
1: Master profile: (Declaration forward parsing and reverse parsing and zone files within the file)
[Email protected] ~]# cd/var/named/chroot/etc/[[email protected] etc]# vim Named.conf[[email protected] etc]# cat named. Conf Options {directory "/var/named";}; Zone "lesliecheung.com." In {type master;file "Lesliecheung.com.zone";}; Zone "100.168.192.in-addr.arpa" in {type Master;file "192.168.100.arpa";};
2: Zone file:
[Email protected] ~]# cd/var/named/chroot/var/named/
[Email protected] named]# vim leslie.com.zone# #添加正向解析 [[email protected] named]# cat Leslie.com.zone $TTL 86400@ INSOAlesliecheung.com.root.lesliecheung.com. (201506301h2m3w1d) @INNSns. Lesliecheung.com.mailINMX 10mail.lesliecheung.com.@ ina192.168.100.100mailina192.168.100.100nsina192.168.100.100ftpina192.168.100.100ntpincnamenswwwina192.168.100.150
# #添加反向解析: [[email protected] named]# cat 192.168.100.arpa $TTL 86400@INSOAlesliecheung.com.root.lesliecheung.com. (201506301H2M3W1D) @INNSns. Lesliecheung.com.mailINMX 10mail.lesliecheung.com.100inptrns.lesliecheung.com.100inptrntp.lesliecheung.com.100inptrftp.lesliecheung.com.150inptrwww . lesliecheung.com.
Modify the DNS software named to belong to:
[Email protected] ~]# [[email protected] ~]# cd/var/named/chroot/[[email protected] chroot]# chown named.named etc/named . conf var/named/leslie.com.zone var/named/192.168.100.arpa [[email protected] chroot]# ll etc/named.conf var/named/ Leslie.com.zone var/named/192.168.100.arpa-rw-r--r--1 named named 196 October 19:48 etc/named.conf-rw-r--r--1 named name D 293 October 19:54 var/named/192.168.100.arpa-rw-r--r--1 named named 287 October 19:52 Var/named/leslie.com.zone
Start DNS:
[[email protected] ~]#/etc/init.d/named start start named: [OK]
Test:
[Email protected] ~]# nslookup> server 192.168.100.100Default server:192.168.100.100address:192.168.100.100#53 > www.lesliecheung.comServer:192.168.100.100Address:192.168.100.100#53Name:www.lesliecheung.comAddress: 192.168.100.150> 192.168.100.150server:192.168.100.100address:192.168.100.100#53150.100.168.192. In-addr.arpaname = www.lesliecheung.com.> 192.168.100.100server:192.168.100.100address:192.168.100.100# 53100.100.168.192.in-addr.arpaname = Ftp.lesliecheung.com.100.100.168.192.in-addr.arpaname = Ns.lesliecheung.com.100.100.168.192.in-addr.arpaname = ntp.lesliecheung.com.
This article is from the "longing for Technology small white" blog, please make sure to keep this source http://lesliecheung.blog.51cto.com/12622169/1971137
Linux DNS Installation configuration