http://jobdahan.net/server_window/17272


DNS 서버인 BIND9을 본격적으로 구동시키기에 앞서 지금까지 설치/설정한 모든 사항들이 실제적으로 정상적인
동작을 하고 있는지 테스트 해 볼 것입니다.

DNS 서버의 데몬(named.exe)을 명령 창(cmd)에서 임시 실행시켜서 에러 유무 확인,
프로세스 창에서 실행된 데몬 확인,
네임서버 질의 명령어 nslookup으로 서브 도메인의 IP 주소 확인 및 ping 명령어로 전송 응답 테스트를 하여
DNS 서버(BIND9의 named)가 정상적으로 동작하고 있는지 확인합니다.


 1) 명령 창(cmd)에서의 named.exe 실행

   C:\APM_Setup\Server\DNS\bin\ 디렉터리에 named.exe 파일이 있는데
   그 디렉터리는 미리 Path를 설정해 주었으므로 cmd 창에서 현재 디렉터리를 이동시키지 않고
   곧 바로 named.exe를 실행할 수 있습니다.

   [시작]-[실행]-cmd 입력하여 cmd 창을 열어서 named.exe -g 라는 명령어를 입력하고 Enter 키를 치면
   아래와 같은 실행 상태가 보여 지고 C:\Documents and Settings\hats>라는 프롬프트가 표시되지 않은 채
   맨 아래에 커서가 깜박거리면서 named 데몬이 실행됩니다.

명령 프롬프트(cmd) 창(에러없이 실행된 예)

C:\Documents and Settings\hats>named -g

30-4-2007 13:58:28.986 starting BIND 9.4.0 -g
30-4-2007 13:58:29.002 found 2 CPUs, using 2 worker threads
30-4-2007 13:58:29.002 loading configuration from 'C:\APM_Setup\Server\DNS\etc\named.conf'
30-4-2007 13:58:29.002 listening on IPv4 interface Loopback Interface 1, 127.0.0.1#53
30-4-2007 13:58:29.002 listening on IPv4 interface TCP/IP Interface 2, 192.168.2.12#53
30-4-2007 13:58:29.017 automatic empty zone: 127.IN-ADDR.ARPA
30-4-2007 13:58:29.017 automatic empty zone: 254.169.IN-ADDR.ARPA
30-4-2007 13:58:29.017 automatic empty zone: 2.0.192.IN-ADDR.ARPA
30-4-2007 13:58:29.017 automatic empty zone: 255.255.255.255.IN-ADDR.ARPA
30-4-2007 13:58:29.017 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.ARPA
30-4-2007 13:58:29.017 automatic empty 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
30-4-2007 13:58:29.017 automatic empty zone: D.F.IP6.ARPA
30-4-2007 13:58:29.017 automatic empty zone: 8.E.F.IP6.ARPA
30-4-2007 13:58:29.017 automatic empty zone: 9.E.F.IP6.ARPA
30-4-2007 13:58:29.017 automatic empty zone: A.E.F.IP6.ARPA
30-4-2007 13:58:29.017 automatic empty zone: B.E.F.IP6.ARPA
30-4-2007 13:58:29.033 command channel listening on 127.0.0.1#953
30-4-2007 13:58:29.033 ignoring config file logging statement due to -g option
30-4-2007 13:58:29.049 zone 0.0.127.in-addr.arpa/IN: loaded serial 1997022700
30-4-2007 13:58:29.049 zone localhost/IN: loaded serial 42
30-4-2007 13:58:29.049 zone jobdahan.dnip.net/IN: loaded serial 2007042710
30-4-2007 13:58:29.049 running
_

   실행 상태를 보고 에러가 있는지 확인합니다. 만약 에러가 있으면 그 메시지를 확인하시고 설정 파일을 꼼꼼히 확인해 주시기
   바랍니다. 위의 경우는 에러가 없이 실행된 상태의 한 예입니다.

   [주의] 이 때 cmd 창을 닫으면 named 데몬의 실행이 중지되어 버립니다.
              그러므로 동작 테스트가 끝날 때까지 반드시 cmd 창을 닫지 않도록 합니다.
              커서가 깜박거리고 있는 그대로 그냥 놔 두십시오.^^;

   [참고] 분명 모든 구문을 이상 없이 입력해 주었는데도 zone 파일을 정상적으로 읽어 들이지 못해 동작이 되지 않는 경우가
   있을 수 있습니다. 아마 텍스트 에디터로 편집하면서 파일의 끝에 들어가는 보이지 않는 코드 때문이지 않았는지 짐작만 할
   뿐입니다. 그렇지만 스트레스는 받지 마십시오. 해결 방법이 없겠습니까?

   아래와 같은 에러 메시지가 나올 경우에는 해당되는 파일을 아예 삭제하시고,
   에러난 파일을 이번에는 메모장을 이용하여 처음부터 다시 입력하여 만드시길 바랍니다.

named.local:11: file does not end with newline
dns_rdata_fromtext: jobdahan.dnip.net.zone:17: unexpected end of input
one jobdahan.dnip.net/IN: loading from master file jobdahan.dnip.net.zone failed: unexpected end of input

   저도 처음 DNS 서버 구축할 때 이 것 때문에 스트레스 엄청 받았습니다.
   혹시라도 설정 파일 내용을 이상 없이 입력했는데도 에러 메시지가 나올 경우 댓글로 에러 메시지와 함께
   에러가 발생된 설정파일 내용도 올려 주시면 같이 해결해 보기로 하겠습니다.


 2) named 데몬 프로세스 확인

   에러가 없을 경우 [Ctrl+Alt+Del] 키를 눌러서 Windows 작업관리자 창을 연 다음
   [프로세스] 탭을 클릭하여 아래 그림과 같이 named.exe가 실행되고 있는지 확인합니다.


 3) 네임서버 질의 명령어 nslookup으로 확인

   named 데몬이 동작되고 있음을 확인했으니 네임서버 질의 명령어(nslookup)를 이용해서
   서브 도메인의 IP 주소를 확인해 볼 차례입니다.

   [시작]-[실행]-cmd 입력하여 cmd 창을 하나 더 열어 놓습니다.
   (왜냐구요? 아까 열어 놓았던 cmd 창은 named 데몬을 실행 중인데 그 창에서 다른 명령을 실행시키기 위해 프롬프트가
    나오게 하려면 named를 중지시켜야 하고, 글케되믄 named 동작을 확인해 볼 수 없게 되기 땜시...)

   새로 열린 cmd 창에서 아래와 같이 nslookup[Enter]을 입력하여 nslookup 모드로 들어갑니다.
   프롬프트가>로 바뀌었을 것입니다.

   이제 생성시킨 서브 도메인들을 각각 입력하여 질의 했을 때 IP 주소가 표시되면
   그 주소가 위에서 작성했던 zone 파일인 jobdahan.dnip.net.zone에서 설정했던 주소인지 확인합니다.
   210.95.205.15 이면 정상적으로 잘 설정되어 동작되고 있는 것입니다.

명령 프롬프트(cmd) 창

C:\Documents and Settings\hats>nslookup
Default Server:  cns3.bora.net
Address:  203.248.252.2

www.jobdahan.dnip.net
Server:  cns3.bora.net
Address:  203.248.252.2

Name:    www.jobdahan.dnip.net
Address:  210.95.205.15

jobdahan.dnip.net
Server:  cns3.bora.net
Address:  203.248.252.2

Name:    jobdahan.dnip.net
Address:  210.95.205.15

mail.jobdahan.dnip.net
Server:  cns3.bora.net
Address:  203.248.252.2

Name:    mail.jobdahan.dnip.net
Address:  210.95.205.15

ftp.jobdahan.dnip.net
Server:  cns3.bora.net
Address:  203.248.252.2

Name:    ftp.jobdahan.dnip.net
Address:  210.95.205.15

shop.jobdahan.dnip.net
Server:  cns3.bora.net
Address:  203.248.252.2

Name:    shop.jobdahan.dnip.net
Address:  210.95.205.15

exit
C:\Documents and Settings\hats> _

   확인이 끝났으면 exit 명령으로 nslookup 모드를 빠져 나옵니다.


 4) ping 명령으로 전송 응답 테스트

   이 번에는 설정된 도메인으로 패킷 데이터(Packet Data)를 보내고 그 응답 상태를 확인하기 위해 방금 nslookup 명령을
   사용했던 cmd 창에서 ping 서브도메인[Enter]의 명령 형식으로 각 도메인들을 테스트합니다.
   nslookup으로 확인이 잘 되었다면 ping 테스트 결과도 정상적일 것입니다.

명령 프롬프트(cmd) 창

C:\Documents and Settings\hats>ping jobdahan.dnip.net

Pinging jobdahan.dnip.net [210.95.205.15] with 32 bytes of data:

Reply from 210.95.205.15: bytes=32 time=1ms TTL=255
Reply from 210.95.205.15: bytes=32 time<1ms TTL=255
Reply from 210.95.205.15: bytes=32 time<1ms TTL=255
Reply from 210.95.205.15: bytes=32 time<1ms TTL=255

Ping statistics for 210.95.205.15:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 1ms, Average = 0ms

C:\Documents and Settings\hats>ping www.jobdahan.dnip.net

Pinging www.jobdahan.dnip.net [210.95.205.15] with 32 bytes of data:

Reply from 210.95.205.15: bytes=32 time<1ms TTL=255
Reply from 210.95.205.15: bytes=32 time<1ms TTL=255
Reply from 210.95.205.15: bytes=32 time<1ms TTL=255
Reply from 210.95.205.15: bytes=32 time<1ms TTL=255

Ping statistics for 210.95.205.15:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms

C:\Documents and Settings\hats>ping shop.jobdahan.dnip.net

Pinging shop.jobdahan.dnip.net [210.95.205.15] with 32 bytes of data:

Reply from 210.95.205.15: bytes=32 time<1ms TTL=255
Reply from 210.95.205.15: bytes=32 time<1ms TTL=255
Reply from 210.95.205.15: bytes=32 time<1ms TTL=255
Reply from 210.95.205.15: bytes=32 time<1ms TTL=255

Ping statistics for 210.95.205.15:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms

C:\Documents and Settings\hats> _

   ping 검사 결과 모두 Packets: Sent = 4, Received = 4, Lost = 0 (0% loss) 임을 알 수 있습니다.
   즉, 4개의 패킷 데이터를 보내서 4개 모두 받아 손실이 0 이라는 의미입니다.

   여기의 예에서는 3개 도메인에 대해서만 확인해 보았지만 여러분들은 설정한 서브 도메인 모두 확인해 보시기 바랍니다.


이제 DNS 서버(BIND9)의 동작 확인이 끝났으니 cmd 창을 두 개 모두 닫아도 좋습니다.
named가 실행되었던 cmd 창을 닫은 다음
Windows 작업관리자 창의 [프로세스] 탭을 보면 named 데몬의 실행이 중지되어 사라지고 없음을 알 수 있습니다.


자, 지금까지의 작업이 순조롭게 잘 되었습니까?

혹시라도 문제가 있으면 글을 올려 주시기 바랍니다.

작업이 잘 되었다면 이제는 임시가 아닌 정상적인 서비스가 되게 설정할 차례입니다.

+ Recent posts