강좌
클라우드/리눅스에 관한 강좌입니다.
리눅스 분류

rndc를 이용한 named데몬 제어

작성자 정보

  • 관리자 작성
  • 작성일

컨텐츠 정보

본문

rndc를 이용한 named데몬 제어

 

 

 

 

 

이제 rndc를 이용한 named를 제어해보도록 하겠다.

 

 

 

 

/etc/rndc.key파일에 인증키가 설정되어있지 않다면 rndc는 제대로 작동하지 않는다.

 

 

 

 

 명심하고 여기서 설명하는 rndc는 앞 절에서 작업한 인증키가 이미 생성되어 적용되고 있다는 것을 전제로 설명한다.

 

 

 

 

 

 

rndc유틸리티를 한마디로 정의하자면 로컬 또는 원격지의 네임서버를 제어하기 위한 관리용 유틸리티이다.

 

 

 

 

 여기서 제어한다라는 의미는 네임서버를 reload, stop 또는 status등의 작업을 하는 것을 의미한다.

 

 

 

 

 

 

먼저 다음과 같이 간단히 rndc에 대한 도움말을 출력해 보기 바란다.

 

 

 

 

 

 

[root@sulinux ~]#rndc -help

Usage: rndc [-c config] [-s server] [-p port] [-k key-file ] [-y key] [-V] command

 

command is one of the following:

 

  reload        Reload configuration file and zones.

  reload zone [class [view]]

                Reload a single zone.

  refresh zone [class [view]]

                Schedule immediate maintenance for a zone.

  retransfer zone [class [view]]

                Retransfer a single zone without checking serial number.

  freeze        Suspend updates to all dynamic zones.

  freeze zone [class [view]]

                Suspend updates to a dynamic zone.

  thaw          Enable updates to all dynamic zones and reload them.

  thaw zone [class [view]]

                Enable updates to a frozen dynamic zone and reload it.

  notify zone [class [view]]

                Resend NOTIFY messages for the zone.

  reconfig      Reload configuration file and new zones only.

  stats         Write server statistics to the statistics file.

  querylog      Toggle query logging.

  dumpdb [-all|-cache|-zones] [view ...]

                Dump cache(s) to the dump file (named_dump.db).

  stop          Save pending updates to master files and stop the server.

  stop -p       Save pending updates to master files and stop the server

                reporting process id.

  halt          Stop the server without saving pending updates.

  halt -p       Stop the server without saving pending updates reporting

                process id.

  trace         Increment debugging level by one.

  trace level   Change the debugging level.

  notrace       Set debugging level to 0.

  flush         Flushes all of the server's caches.

  flush [view]  Flushes the server's cache for a view.

  flushname name [view]

                Flush the given name from the server's cache(s)

  status        Display status of the server.

  recursing     Dump the queries that are currently recursing (named.recursing)

  validation newstate [view]

                Enable / disable DNSSEC validation.

  *restart      Restart the server.

 

* == not yet implemented

Version: 9.6.1b1

[root@sulinux ~]#

 

 

 

보는 바와같이 rndc에 대한 사용법이 다양하다.

 

 

 

 

 이를 자주사용하는 몇가지로 간추려보면 다음과 같다.

 

 

 

 

 

 

- reload      : 설정파일과 zone파일을 다시 읽어서 재적용함.

- reload zone : 특정 zone파일만을 다시 읽어서 재적용함.

- reconfig    : 새로 추가된 zone파일만 읽어서 설정파일을 재적용함.

- stats       : named상황파일에 서버상황을 저장함.

- dumpdb      : 덤프파일(named_dump.db)에 캐시데이터를 덤프함.

- stop        : 저장되지 않은 값을 저장하고 named를 종료함.

- halt        : 저장되지 않은 값을 그냥 두고 named를 종료함.

- flush       : 캐시데이터를 디스크에 저장하여 동기화함.

- status      : named데몬의 상태를 출력함.

 

 

 

 

 

rndc의 여러가지 기능 가운데 주로 사용하는 예를 몇가지 들어보겠다.

 

 

 

 

 다음은 rndc reload옵션을 사용하여 설정파일과 zone파일을 다시 읽어서 재적용한 예이다.

 

 

 

 

 

 

[root@sulinux ~]#/usr/sbin/rndc reload

server reload successful

[root@sulinux ~]#

 

 

 

그리고 다음은 rndc reconfig옵션을 사용하여 새로 추가된 zone파일만 읽어서 설정파일을 재적용한 것이다.

 

 

 

 

 

 

[root@sulinux ~]#/usr/sbin/rndc reconfig

[root@sulinux ~]#

 

 

 

그리고 다음은 rndcstop옵션을 사용하여 저장되지 않은 값을 저장하고 named를 종료한 예이다.

 

 

 

 

 



[root@sulinux ~]#/usr/sbin/rndc stop

[root@sulinux ~]#

 

 

 

그리고 다음은 rndc status옵션을 사용하여 named데몬의 상태를 출력한 예이다.

 

 

 

 

 

 

[root@sulinux ~]#/usr/sbin/rndc status

number of zones: 8

debug level: 0

xfers running: 0

xfers deferred: 0

soa queries in progress: 0

query logging is OFF

recursive clients: 0/1000

tcp clients: 0/100

server is up and running

[root@sulinux ~]#

 

 

 

 

위의 결과로 알 수 있는 것은 현재 named가 서비스하고 있는 zone파일의 개수는 모두 8개이며  debug레벨이 0이며, 현재 named가 실행중에 있다는 정보등을 알 수 있다.

 

관련자료

댓글 0
등록된 댓글이 없습니다.

공지사항


뉴스광장


  • 현재 회원수 :  60,037 명
  • 현재 강좌수 :  35,806 개
  • 현재 접속자 :  94 명