Está en la página 1de 3

Setup Primary(Master) DNS Server [root@masterdns ~]# yum install bind* -y 1.

Configure DNS Server Add the lines as shown below in /etc/named.conf file [root@masterdns ~]# vi /etc/named.conf // named.conf // Provided by Red Hat bind pac a!e to confi!ure t"e #$% &#'( named)*+ ('$ // server as a cac"in! only nameserver )as a local"ost ('$ resolver only+. // $ee /usr/s"are/doc/bind*/sample/ for e,ample named confi!uration files. options listen-on port ./ - 012.3.3.04 192.168.1.100; 54 ### Master DNS IP ### listen-on-v6 port ./ - 7704 54 directory 8/var/named84 dump-file 8/var/named/data/cac"e9dump.db84 statistics-file 8/var/named/data/named9stats.t,t84 memstatistics-file 8/var/named/data/named9mem9stats.t,t84 allo:-;uery - local"ost4 192.168.1.0/24; 54 ### IP Range ### allo:-transfer- local"ost4 192.168.1.101; 54 ### Slave DNS IP ### recursion yes4 dnssec-enable yes4 dnssec-validation yes4 dnssec-loo aside auto4 /* Pat" to #$% (<= ey */ bind eys-file 8/etc/named.iscdlv. ey84 mana!ed- eys-directory 8/var/named/dynamic84 54 lo!!in! c"annel default9debu! file 8data/named.run84 severity dynamic4 54 54 >one 8.8 #' type "int4 file 8named.ca84 54 zone" n!"#en.lo$al" IN % t&'e #aster; (!le "(or)ar*. n!"#en"; allo)+ '*ate % none; ,; ,; zone"1.168.192.!n+a**r.ar'a" IN % t&'e #aster; (!le "reverse. n!"#en"; allo)+ '*ate % none; ,; ,; include 8/etc/named.rfc0?01.>ones84 include 8/etc/named.root. ey84 . Create !one fi"es Create forward and reverse zone files which we mentioned in the /etc/named.conf file. .1 Create #or$ard !one Create forward.unixmen file in the /var/named directory.

[root@masterdns ~]# vi /var/named/for:ard.uni,men @AA< *6B33 @ #' $CD masterdns.uni,men.local. root.uni,men.local. ) 1300320330 4$erial /633 4Refres" 0*33 4Retry 63B*33 4E,pire *6B33 4Finimum AA< '$ '$ D D D #' #' #' D D D masterdns.uni,men.local. secondarydns.uni,men.local. 0?1.06*.0.033 0?1.06*.0.030 0?1.06*.0.031 0?1.06*.0.033 0?1.06*.0.030 0?1.06*.0.031

+ @ #' @ #' @ #' @ #' @ #' masterdns secondarydns client

. Create %everse !one Create reverse.unixmen file in the /var/named directory. [root@masterdns ~]# vi /var/named/reverse.uni,men @AA< *6B33 @ #' $CD masterdns.uni,men.local. root.uni,men.local. ) 4$erial 4Refres" 4Retry 4E,pire 4Finimum AA< masterdns.uni,men.local. secondarydns.uni,men.local. uni,men.local. #' #' #' PAR PAR PAR D D D 0?1.06*.0.033 0?1.06*.0.030 0?1.06*.0.031 masterdns.uni,men.local. secondarydns.uni,men.local. client.uni,men.local.

+ @ @ @

1300320330 /633 0*33 63B*33 *6B33 #' #' #' '$ '$ PAR

masterdns secondarydns client 033 030 031 #' #' #'

&. Start t'e DNS service [root@masterdns ~]# service named start $tartin! named7 [root@masterdns ~]# c" confi! named on (. )d*ust ipta+"es to a""o$ DNS server from outside of t'e net$or, Add the lines as shown below in /etc/sysconfig/ipta+"es file. [root@masterdns ~]# vi /etc/sysconfi!/iptables # Hire:all confi!uration :ritten by system-confi!-fire:all # Fanual customi>ation of t"is file is not recommended. [ CG ]

*filter 7#'PIA D%%EPA [373] 7HCRJDR( D%%EPA [373] 7CIAPIA D%%EPA [373] +- INP./ +' *' +# state ++state N01 ++*'ort 23 +4 -550P/ +- INP./ +' t$' +# state ++state N01 ++*'ort 23 +4 -550P/ -D #'PIA -m state --state E$AD&<#$HE(KRE<DAE( -L D%%EPA -D #'PIA -p icmp -L D%%EPA -D #'PIA -i lo -L D%%EPA -D #'PIA -m state --state 'EJ -m tcp -p tcp --dport 11 -L D%%EPA -D #'PIA -L REME%A --reLect-:it" icmp-"ost-pro"ibited -D HCRJDR( -L REME%A --reLect-:it" icmp-"ost-pro"ibited %CFF#A -. %estart ipta+"es [root@masterdns ~]# service iptables restart iptables7 Hlus"in! fire:all rules7 iptables7 $ettin! c"ains to policy D%%EPA7 filter iptables7 Inloadin! modules7 iptables7 Dpplyin! fire:all rules7 .. /est DNS configuration and 0one fi"es for any synta1 errors [root@masterdns ~]# named-c"ec conf /etc/named.conf [root@masterdns ~]# named-c"ec >one uni,men.local /var/named/for:ard.uni,men >one uni,men.local/#'7 loaded serial 1300320330 CG [root@masterdns ~]# named-c"ec >one uni,men.local /var/named/reverse.uni,men >one uni,men.local/#'7 loaded serial 1300320330 CG 2. /est DNS Server [root@masterdns ~]# di! masterdns.uni,men.local 4 NNOO (iP ?.*.1rc0-RedHat-?.*.1-3.03.rc0.el69/.6 NNOO masterdns.uni,men.local 44 !lobal options7 Qcmd 44 Pot ans:er7 44 -OOHED(ERNN- opcode7 RIERSK status7 'CERRCRK id7 B?*/B 44 fla!s7 ;r aa rd ra4 RIERS7 0K D'$JER7 0K DIAHCR#AS7 1K D((#A#C'D<7 0 44 RIE$A#C' $E%A#C'7 4masterdns.uni,men.local.#'D 44 D'$JER $E%A#C'7 masterdns.uni,men.local. *6B33#'D0?1.06*.0.033 44 DIAHCR#AS $E%A#C'7 uni,men.local.*6B33#''$secondarydns.uni,men.local. uni,men.local.*6B33#''$masterdns.uni,men.local. 44 D((#A#C'D< $E%A#C'7 secondarydns.uni,men.local. *6B33 #'D0?1.06*.0.030 44 Ruery time7 6 msec 44 $ER=ER7 0?1.06*.0.033#./)0?1.06*.0.033+ 44 JHE'7 A"u Far 2 0/7327.6 130/ 44 F$P $#TE rcvd7 00B [root@masterdns ~]# nsloo up uni,men.local $erver70?1.06*.0.033 Dddress70?1.06*.0.033#./ 'ame7uni,men.local Dddress7 0?1.06*.0.031 'ame7uni,men.local Dddress7 0?1.06*.0.033 'ame7uni,men.local Dddress7 0?1.06*.0.030 - See more at: http://www.unixmen.com/dns-server-installation-step-by-step-using-centos- !/"sthash.#S$d%wr&.dpuf [ [ [ [ CG CG CG CG ] ] ] ]

También podría gustarte