2020. 4. 21.

[Linux] DNS 루트서버부터 전체 구조 만들기 실습 정리


전체 DNS 만들것이다.
나에게 할당된건 root DNS 캐시 DNS이다.


root서버의 역할은
전체 구조도 만들어서 배포. named.ca 만들어서 배포
vi /var/named/named.ca

;       This file holds the information on root name servers needed to
;       initialize cache of Internet domain name servers
;       (e.g. reference this file in the "cache  .  <file>"
;       configuration file of BIND domain name servers).
;
;       This file is made available by InterNIC
;       under anonymous FTP as
;           file                /domain/named.cache
;           on server           FTP.INTERNIC.NET
;       -OR-                    RS.INTERNIC.NET
;
;       last update:    Feb 04, 2008
;       related version of root zone:   2008020400
;
; formerly NS.INTERNIC.NET
;
.                        3600000  IN  NS    A.ROOT-SERVERS.NET.
A.ROOT-SERVERS.NET.      3600000      A     192.168.10.152


A.ROOT IPv4 아이피를 넣어줘야한다. IPv6넣으면 안된다.

This file holds the information on name servers needed to 
initialize cache of Internet domain name servers 
(e.g. reference this file in the "cache 
configuration file of BIND domain name 
This file is made available by InterNIC 
under anonymous FTP as 
file 
on sewer 
last update: 
'domain/ named . cache 
FTP.INTERUIC.UET 
RS. INTERNIC.NET 
Feb ø4, 2øø8 
related version of zone: 
• formerly NS. INTERNIC.NET 
36øøøøe 
ROOT-SERVERS.NET. 
2øø8ø2ø4øø 
A. ROOT-SERVERS. NET. 
192.168.1e.152

vi /etc/named.conf
루트서버는 최상위 도메인이라 named.ca 필요없음.

options {
directory "/var/named";
};

zone "." {
type master;
file "root.zone";};

x 
root@centl 52:/var/named 
options { 
directory "/var/named"• 
zone 
pe master; 
file "root. zone¯;}•

touch root.zone
chgrp named root.zone
chmod -R 770 /var/named

Croot@cent152 touch Zone 
Croot@cent152 chgrp named Zone 
Croot@cent152 Is 
data 
named . ca 
n amed . empty 
named . Ioopback 
. Zone 
slaves 
dynamic 
nsmed -pmssve 
named . localhost 
Croot@cent152 Is -al 
d nvxr-xr-x. 
- rwxrwxrwx 
-mA-r--r-- 
rcot 
23 
rcOt 
n a med 
2 
n a med 
2 
I rcOt 
I rcOt 
I rcOt 
I rcOt 
I rcOt 
I rcOt 
n a med 
2 
named 168 
rcOt 4ß96 
n a med 
n a med 
n a med 
n a med 
n a med 
n a med 
n a med 
n a med 
n a med 
6 
6 
789 
288e 
152 
152 
168 
6 
-R 77e 
21 
8 
8 
21 
15 
21 
15 
21 
le: 21 
le: 23 
21319 
21319 
le: 19 
13:213 
2øøg 
2øe7 
2øøg 
le: 21 
21319 
Croot@cent152 chmod 
/ va r/ n amed 
Croot@cent152 Is -al 
not 
dnvxr-xr-x. 23 
rcOt 
n a med 
2 
n a med 
2 
I rcOt 
I rcOt 
I rcOt 
I rcOt 
I rcOt 
I rcOt 
2 named 
Croot@cent152 
n a med 
n a med 
n a med 
n a med 
n a med 
n a med 
n a med 
n a med 
n a med 
n a med 
168 
6 
6 
789 
288e 
152 
152 
168 
6 
21 
8 
8 
21 
15 
21 
15 
21 
8 
le: 21 
le: 23 
21319 
21319 
le: 19 
13:213 
2øeg 
2øe7 
2øeg 
le: 21 
2ø19 
data 
dynamic 
named . ca 
nsmed -pmssve 
n amed . empty 
named . localhost 
named . Ioopback 
rcOt . Zone 
slaves 
data 
dynamic 
nsmed .cs 
nsmed .cs . rpmssve 
named . empty 
nsmed . Iccslhcst 
nsmed . Iccpbsck 
rcct .zcne 
slaves

vi /var/named/root.zone
들어가서 수정하고 맞춰줘야함


$TTL 1D
@ IN SOA ns. root.ns. (
                                        3       ; serial
                                        1D      ; refresh
                                        1H      ; retry
                                        1W      ; expire
                                        3H )    ; minimum

                IN      NS      ns.
                IN      A       192.168.10.152
ns              IN      A       192.168.10.152

edu.            IN      NS      ns.edu.
ns.edu.         IN      A       192.168.10.157

kr.             IN      NS      ns.kr.
ns.kr.          IN      A       192.168.10.162

kst14.          IN      NS      ns.kst14.
ns.kst14.       IN      A       192.168.10.167

deekay.         IN      NS      ns.deekay.
ns.deekay.      IN      A       192.168.10.172


*TTL ID 
@ IN SOA ns. root.ns. 
serial 
ref re s h 
retry 
exp Ire 
nun Imum 
ns.edu. 
ns.kr. 
kst14. 
ns . kst14. 
deekay. 
ns . deekay. 
" /var/ named/ root 
. zone 
" 41L, 
192.168.1ø.152 
192.168.1ø.152 
ns.edu. 
192.168.1ø.157 
ns.kr. 
192.168.1ø.162 
ns . kst14. 
192.168.1ø.167 
ns . deekay. 
192.168.1ø.172 
94 IC


vi /etc/resolv.conf
수정해준다.
nameserver 192.168.10.152

# Generated by Networkmanager 
nameserver 192.168. Ia. IS

vi /etc/sysconfig/network-scripts/ifcfg-ens32

TYPE z" Ethernet" 
PROXY 
ROWSER 
800TPROT0=" none" 
I pv4 FAILURE FATAL=" n o" 
IPV6 
IPV6 FAILURE FATAL ' 
= 'no" 
" stable-privacy" 
IPV6 ADDR GEN 
LILIID=" 5fd7a Ife- cf8f -4935 -a cfø-9dece7ß59a49" 
PREFIX-"24" 
IPV6 
" / etc/ sys config/ network- s c if cfg-en s 32 
" 2øL, 
4øgc

DNS1="192.168.10.152" 입력
systemctl restart named

*캐시 서버 설정

vi /etc/sysconfig/network-scripts/ifcfg-ens32

root@153:- 
PROXY 
ROWSER 
800TPROT0=" none" 
I pv4 FAILURE FATAL=" n o" 
IPV6 
IPV6 
IPV6 FAILURE FATAL ' 
= 'no" 
" stable-privacy" 
IPV6 ADDR GEN 
PREFIX-"24" 
153" 
IPV6 
" / etc/ sys config/ network- s c ripts/ if cfg-ens32 
" 2øL, 
4øgc

DNS1="192.168.10.153" 입력

vi /etc/resolv.conf
nameserver 192.168.10.153

root@153:- 
Generated by Networkmanager 
192.168.113.153 
" 'etc/ resolv. conf 
56C

vi /etc/named.conf

x 
root@153:- 
'*ions { 
directory " ; 
type hint; 
file "named. ca";

options {
directory "/var/named";
};

zone "." {
type hint;
file "named.ca";
};


vi /var/named/named.ca

;       This file holds the information on root name servers needed to
;       initialize cache of Internet domain name servers
;       (e.g. reference this file in the "cache  .  <file>"
;       configuration file of BIND domain name servers).
;
;       This file is made available by InterNIC
;       under anonymous FTP as
;           file                /domain/named.cache
;           on server           FTP.INTERNIC.NET
;       -OR-                    RS.INTERNIC.NET
;
;       last update:    Feb 04, 2008
;       related version of root zone:   2008020400
;
; formerly NS.INTERNIC.NET
;
.                        3600000  IN  NS    A.ROOT-SERVERS.NET.
A.ROOT-SERVERS.NET.      3600000      A     192.168.10.152


root@153:- 
This file holds the information on name servers needed to 
initialize cache of Internet domain name servers 
(e.g. reference this file in the "cache 
configuration file of BIND domain name 
This file is made available by InterNIC 
under anonymous FTP as 
file 
on sewer 
'domain/ named . cache 
FTP.INTERUIC.UET 
RS. INTERNIC.NET 
last update: 
Feb ø4, 2øø8 
related version of zone: 
• formerly NS. INTERNIC.NET 
36øøøøe 
2øø8ø2ø4øø 
A. ROOT-SERVERS. NET. 
192.168.1e.152 
A. ROOT-SERVERS.NET. 
" /var/ named/ named . ca" 
18L, 
72øc

systemctl restart named

*154번으로 테스팅

vi /etc/resolv.conf
nameserver 192.168.10.168

root@154:- 
# Generated by 
nameserver 192 
NetworkMa n a ger 
.168.1e.16

host jjh.bin
host dk.kst14

root@154:- 
Croot@154 host jjh.bin 
jjh.bin has address 192.168.1ø.188 
Croot@154 host dk. kst14 
dk. kst14 has address 192.168.1ø.173 
Croot@154


댓글 없음:

댓글 쓰기