[AIX 네트워크 관리 16] TCP/IP (10) 전달자, 이름 서버 쓰는 호스트, 동적 영역, BIND 9 보안

핵심 정리

  • forwarder 서버는 options { forwarders { 주소; …; }; }로 로컬에서 못 푸는 질의를 지정한 서버로 넘기고, forward only 서버는 forward only;를 더해 직접 루트 서버에 묻지 않습니다. 비슷한 효과를 /etc/resolv.conf의 nameserver 줄로도 낼 수 있습니다. named는 smit stnamed나 /etc/rc.tcpip의 start /etc/named 줄로 켭니다.
  • 호스트가 이름 서버를 쓰게 하려면 /etc/resolv.conf에 domain 도메인과 nameserver 주소(3개까지, 나열 순서대로 질의), 필요하면 search 도메인 목록(1024자까지)을 넣고 host 이름으로 시험합니다. SMIT 빠른 경로는 mknamerslv, rmnamerslv, stnamerslv, spnamerslv, mkdomain 등입니다.
  • 동적 영역: 영역 스탠자에 allow-update { … };. 보안 모드는 unsecured(기본, 권장하지 않음), controlled(새 정보 만들기·바꾸기 허용, 서명 필요), presecured(바꾸기만, 서명 필요)이며 update-security로 정합니다. 키 쌍은 nsupdate -g로 만들고 KEY 레코드(호스트 0x0000, 영역 0x0100)를 데이터 파일에 넣습니다.
  • BIND 9(named9, nsupdate9로 링크를 바꿔 씀): TSIG는 dnssec-keygen -a HMAC-MD5 -b 128 -n HOST 키이름으로 공유 키를 만들어 key 문과 allow-transfer·allow-update { key …; }, slave의 server … { keys … }로 영역 전송과 갱신을 제한합니다. SIG(DNSSEC, RFC 2535 일부)는 RSA 영역 키로 신뢰 루트(trusted-keys)를 정하고, 하위 영역 키셋을 부모가 서명한 뒤 dnssec-signzone으로 영역을 서명해 .signed 파일을 씁니다.
항목 내용
버전 AIX 5.3, AIX 6.1 (6.1에서 Files Reference 안내 문장이 더해짐)
원문 Networks and communication management — 5.3판 150162쪽, 6.1판 196208쪽
파일 /etc/named.conf, /usr/samples/tcpip/named.conf, /etc/resolv.conf, /etc/rc.tcpip, /etc/keyfile
관련 명령어 smit stnamed, startsrc -s named, host, nsupdate, dnssec-keygen, dnssec-makekeyset, dnssec-signkey, dnssec-signzone

전달자(forwarder) 구성하기

forwarder 서버를 구성하려면 Web-based System Manager(wsm)나 이 절차를 씁니다. 여러 파일을 편집한 다음 SMIT나 명령줄로 named 데몬을 시작합니다.

  1. /etc/named.conf 파일을 편집합니다. /etc 디렉터리에 named.conf 파일이 없으면 /usr/samples/tcpip/named.conf 예제 파일을 /etc 디렉터리에 복사해 편집합니다. 자세한 설명과 conf 파일 예는 Files Reference의 named.conf File Format for TCP/IP를 봅니다.
    • /etc/named.conf 파일의 options 스탠자에, 전달된 요청을 받을 이름 서버의 IP 주소를 나열한 forwarders 줄을 지정합니다. 예:
text
options {
    ...
    directory "/usr/local/domain";
    forwarders { 192.100.61.1; 129.35.128.222; };
    ...
};
  • 루프백 영역을 지정합니다. 예:
text
zone "0.0.127.in-addr.arpa" in {
    type master;
    file "named.abc.local";
};
  • hint 영역을 지정합니다. 예:
text
zone "." IN {
    type hint;
    file "named.ca";
};
  1. /usr/local/domain/named.ca 파일을 편집합니다. 이 파일에는 네트워크 루트 도메인의 권한 있는 이름 서버 주소가 들어 있습니다. 자세한 설명과 cache 파일 예는 Files Reference의 DOMAIN Cache File Format for TCP/IP를 봅니다. 예:
text
; root name servers.
.          IN    NS    relay.century.com.
relay.century.com.   3600000    IN    A     129.114.1.2

참고: 이 파일의 모든 줄은 Standard Resource Record Format이어야 합니다.

  1. /usr/local/domain/named.abc.local 파일을 편집합니다. 자세한 설명과 local 데이터 파일 예는 Files Reference의 DOMAIN Local Data File Format for TCP/IP를 봅니다.

    1. 영역의 SOA(start of authority)와 기본 TTL 정보를 지정합니다. 예:
text
$TTL 3h    ;3 hour
@ IN SOA venus.abc.aus.century.com. gail.zeus.abc.aus.century.com.  (
                           1       ;serial
                           3600    ;refresh
                           600     ;retry
                           3600000 ;expire
                           86400   ;negative caching TTL
)
  1. 이름 서버(NS) 레코드를 지정합니다. 예:
text
<tab> IN    NS     venus.abc.aus.century.com.
  1. 포인터(PTR) 레코드를 지정합니다.
text
1      IN    PTR    localhost.

참고: 이 파일의 모든 줄은 Standard Resource Record Format이어야 합니다.

  1. 다음 명령으로 /etc/resolv.conf 파일을 만듭니다.
text
touch /etc/resolv.conf

이 파일이 있으면 호스트가 이름 풀이에 /etc/hosts 파일이 아니라 이름 서버를 써야 한다는 뜻입니다. 또는 /etc/resolv.conf 파일에 다음 항목을 넣을 수 있습니다.

text
nameserver 127.0.0.1

127.0.0.1은 루프백 주소이므로 호스트가 자기 자신을 이름 서버로 씁니다. /etc/resolv.conf 파일에는 다음과 같은 항목도 넣을 수 있습니다.

text
domain domainname

이 예에서 domainname 값은 austin.century.com입니다.

  1. 다음 가운데 하나를 합니다.
    • smit stnamed SMIT 빠른 경로로 named 데몬을 켭니다. 그러면 시스템이 시작할 때마다 데몬이 초기화됩니다. named 데몬을 지금 시작할지, 다음 시스템 재시작 때 시작할지, 둘 다 할지 고릅니다.
    • /etc/rc.tcpip 파일을 편집합니다. 다음 줄 앞의 주석(#) 기호를 지워 named 데몬 줄의 주석을 풉니다.
text
#start /etc/named "$src_running"

그러면 시스템이 시작할 때마다 데몬이 초기화됩니다.

  1. SMIT로 named 데몬을 초기화하지 않기로 했다면 다음 명령으로 이번 세션에 데몬을 시작합니다.
text
startsrc -s named
영어 원문

Configuring a forwarder

To configure a forwarder server, use the Web-based System Manager, wsm, or use this procedure, which edits a series of files and then uses SMIT or the command line to start the named daemon.

  1. Edit the /etc/named.conf file. If there is no named.conf file in the /etc directory, copy the /usr/samples/tcpip/named.conf sample file into the /etc directory and edit it. See the "named.conf File Format for TCP/IP" in the Files Reference for more information and a detailed example of a conf file.
  • Specify a forwarders line in the options stanza of the /etc/named.conf file that lists the IP addresses of the name servers that should receive the forwarded requests. For example:
text
options {
    ...
    directory "/usr/local/domain";
    forwarders { 192.100.61.1; 129.35.128.222; };
    ...
};
  • Specify the loopback zone. For example:
text
zone "0.0.127.in-addr.arpa" in {
    type master;
    file "named.abc.local";
};
  • Specify the hint zone. For example:
text
zone "." IN {
    type hint;
    file "named.ca";
};
  1. Edit the /usr/local/domain/named.ca file. See the "DOMAIN Cache File Format for TCP/IP" in the Files Reference for more information and a detailed example of a cache file. This file contains the addresses of the servers that are authoritative name servers for the root domain of the network. For example:
text
; root name servers.
.          IN    NS    relay.century.com.
relay.century.com.   3600000    IN    A     129.114.1.2

Note: All lines in this file must be in Standard Resource Record Format.

  1. Edit the /usr/local/domain/named.abc.local file. See the DOMAIN Local Data File Format for TCP/IP in the Files Reference for more information and a detailed example of a local data file. a. Specify the start of authority (SOA) of the zone and the default time-to-live information. For example:
text
$TTL 3h    ;3 hour
@ IN SOA venus.abc.aus.century.com. gail.zeus.abc.aus.century.com.  (
                           1       ;serial
                           3600    ;refresh
                           600     ;retry
                           3600000 ;expire
                           86400   ;negative caching TTL
)
  1. Specify the name server (NS) record. For example:
text
<tab> IN    NS     venus.abc.aus.century.com.
  1. Specify the pointer (PTR) record.
text
1      IN    PTR    localhost.

Note: All lines in this file must be in Standard Resource Record Format.

  1. Create an /etc/resolv.conf file by typing the following command:
text
touch /etc/resolv.conf

The presence of this file indicates that the host should use a name server, not the /etc/hosts file, for name resolution. Alternatively, the /etc/resolv.conf file might contain the following entry:

text
nameserver 127.0.0.1

The 127.0.0.1 address is the loopback address, which causes the host to access itself as the name server. The /etc/resolv.conf file may also contain an entry like the following:

text
domain domainname

In the previous example, the domainname value is austin.century.com.

  1. Perform one of the following steps:
  • Enable the named daemon using the smit stnamed SMIT fast path. This initializes the daemon with each system startup. Indicate whether you want to start the named daemon now, at the next system restart, or both.

  • Edit the /etc/rc.tcpip file. Uncomment the line for the named daemon by removing the comment (#) symbol from the following line:

text
#start /etc/named "$src_running"

This initializes the daemon with each system startup.

  1. If you chose not to initialize the named daemon through SMIT, start the daemon for this session by typing the following command:
text
startsrc -s named

전달 전용(forward only) 이름 서버 구성하기

forward only 이름 서버를 구성하려면 Web-based System Manager(wsm)나 이 절차를 씁니다. 여러 파일을 편집한 다음 SMIT나 명령줄로 named 데몬을 시작합니다.

참고: forward only 이름 서버를 실행하지 않고도 비슷한 구성을 할 수 있습니다. 쓰려는 forwarder를 가리키는 nameserver 줄이 든 /etc/resolv.conf 파일을 만들면 됩니다.

  1. /etc/named.conf 파일을 편집합니다. /etc 디렉터리에 named.conf 파일이 없으면 /usr/samples/tcpip/named.conf 예제 파일을 /etc 디렉터리에 복사해 편집합니다. 자세한 설명과 conf 파일 예는 Files Reference의 named.conf File Format for TCP/IP를 봅니다.
    • /etc/named.conf 파일의 options 스탠자에, 전달된 요청을 받을 이름 서버의 IP 주소를 나열한 forwarders 줄과 forward only 줄을 지정합니다. 예:
text
options {
    ...
    directory "/usr/local/domain";
    forwarders { 192.100.61.1;  129.35.128.222; };
    forward only;
    ...
};
  • 루프백 영역을 지정합니다. 예:
text
zone "0.0.127.in-addr.arpa" in {
    type master;
    file "named.abc.local";
};
  • hint 영역을 지정합니다. 예:
text
zone "." IN {
    type hint;
    file "named.ca";
};
  1. /usr/local/domain/named.ca 파일을 편집합니다. 이 파일에는 네트워크 루트 도메인의 권한 있는 이름 서버 주소가 들어 있습니다. 자세한 설명과 cache 파일 예는 Files Reference의 DOMAIN Cache File Format for TCP/IP를 봅니다. 예:
text
; root name servers.
.          IN    NS    relay.century.com.
relay.century.com.   3600000    IN    A     129.114.1.2

참고: 이 파일의 모든 줄은 Standard Resource Record Format이어야 합니다.

  1. /usr/local/domain/named.abc.local 파일을 편집합니다. 자세한 설명과 local 데이터 파일 예는 Files Reference의 DOMAIN Local Data File Format for TCP/IP를 봅니다.

    1. 영역의 SOA(start of authority)와 기본 TTL 정보를 지정합니다. 예:
text
$TTL 3h    ;3 hour
@ IN SOA venus.abc.aus.century.com. gail.zeus.abc.aus.century.com.  (
                           1       ;serial
                           3600    ;refresh
                           600     ;retry
                           3600000 ;expire
                           86400   ;negative caching TTL
)
  1. 이름 서버(NS) 레코드를 지정합니다. 예:
text
<tab> IN    NS     venus.abc.aus.century.com.
  1. 포인터(PTR) 레코드를 지정합니다.
text
1      IN    PTR    localhost.

참고: 이 파일의 모든 줄은 Standard Resource Record Format이어야 합니다.

  1. 다음 명령으로 /etc/resolv.conf 파일을 만듭니다.
text
touch /etc/resolv.conf

이 파일이 있으면 호스트가 이름 풀이에 /etc/hosts 파일이 아니라 이름 서버를 써야 한다는 뜻입니다. 또는 /etc/resolv.conf 파일에 다음 항목을 넣을 수 있습니다.

text
nameserver 127.0.0.1

127.0.0.1은 루프백 주소이므로 호스트가 자기 자신을 이름 서버로 씁니다. /etc/resolv.conf 파일에는 다음과 같은 항목도 넣을 수 있습니다.

text
domain domainname

이 예에서 domainname 값은 austin.century.com입니다.

  1. 다음 가운데 하나를 합니다.
    • smit stnamed SMIT 빠른 경로로 named 데몬을 켭니다. 그러면 시스템이 시작할 때마다 데몬이 초기화됩니다. named 데몬을 지금 시작할지, 다음 시스템 재시작 때 시작할지, 둘 다 할지 고릅니다.
    • /etc/rc.tcpip 파일을 편집합니다. 다음 줄 앞의 주석(#) 기호를 지워 named 데몬 줄의 주석을 풉니다.
text
#start /etc/named "$src_running"

그러면 시스템이 시작할 때마다 데몬이 초기화됩니다.

  1. SMIT로 named 데몬을 초기화하지 않기로 했다면 다음 명령으로 이번 세션에 데몬을 시작합니다.
text
startsrc -s named
영어 원문

Configuring a forward only name server

To configure a forward only name server, use the Web-based System Manager, wsm, or use this procedure, which edits a series of files and then uses SMIT or the command line to start the named daemon.

Note: You can achieve a similar configuration without running a forward only name server. Instead, create an /etc/resolv.conf file that contains name server lines that point to the forwarders you wish to use.

  1. Edit the /etc/named.conf file. If there is no named.conf file in the /etc directory, copy the /usr/samples/tcpip/named.conf sample file into the /etc directory and edit it. See the named.conf File Format for TCP/IP in the Files Reference for more information and a detailed example of a conf file.
  • Specify the forwarders and forward only lines in the options stanza of the /etc/named.conf file listing the IP addresses of the name servers receiving the forwarded requests. For example:
text
options {
    ...
    directory "/usr/local/domain";
    forwarders { 192.100.61.1;  129.35.128.222; };
    forward only;
    ...
};
  • Specify the loopback zone. For example:
text
zone "0.0.127.in-addr.arpa" in {
    type master;
    file "named.abc.local";
};
  • Specify the hint zone. For example:
text
zone "." IN {
    type hint;
    file "named.ca";
};
  1. Edit the /usr/local/domain/named.ca file. For example: See the DOMAIN Cache File Format for TCP/IP in Files Reference for more information and a detailed example of a cache file. This file contains the addresses of the servers that are authoritative name servers for the root domain of the network.
text
; root name servers.
.          IN    NS    relay.century.com.
relay.century.com.   3600000    IN    A     129.114.1.2

Note: All lines in this file must be in Standard Resource Record Format.

  1. Edit the /usr/local/domain/named.abc.local file. See the DOMAIN Local Data File Format for TCP/IP in the Files Reference for more information and a detailed example of a local data file. a. Specify the start of authority (SOA) of the zone and the default time-to-live information. For example:
text
$TTL 3h    ;3 hour
@ IN SOA venus.abc.aus.century.com. gail.zeus.abc.aus.century.com.  (
                           1       ;serial
                           3600    ;refresh
                           600     ;retry
                           3600000 ;expire
                           86400   ;negative caching TTL
)
  1. Specify the name server (NS) record. For example:
text
<tab> IN    NS     venus.abc.aus.century.com.
  1. Specify the pointer (PTR) record.
text
1      IN    PTR    localhost.

Note: All lines in this file must be in Standard Resource Record Format.

  1. Create an /etc/resolv.conf file by typing the following command:
text
touch /etc/resolv.conf

The presence of this file indicates that the host should use a name server, not the /etc/hosts file, for name resolution. Alternatively, the /etc/resolv.conf file might contain the following entry:

text
nameserver 127.0.0.1

The 127.0.0.1 address is the loopback address, which causes the host to access itself as the name server. The /etc/resolv.conf file can also contain an entry such as:

text
domain domainname

In the previous example, the domainname value is austin.century.com.

  1. Perform one of the following steps:
  • Enable the named daemon using the smit stnamed SMIT fast path. This initializes the daemon with each system startup. Indicate whether you want to start the named daemon now, at the next system restart, or both.

  • Edit the /etc/rc.tcpip file. Uncomment the line for the named daemon by removing the comment (#) symbol from the following line:

text
#start /etc/named "$src_running"

This initializes the daemon with each system startup.

  1. If you chose not to initialize the named daemon through SMIT, start the daemon for this session by typing the following command:
text
startsrc -s named

호스트가 이름 서버를 쓰도록 구성하기

호스트가 이름 서버를 쓰도록 구성하려면 Web-based System Manager(wsm)나 이 절차를 씁니다.

  1. 다음 명령으로 /etc/resolv.conf 파일을 만듭니다.
text
touch /etc/resolv.conf
  1. /etc/resolv.conf 파일의 첫 줄에 domain이라는 단어와 이 호스트가 속한 도메인의 전체 이름을 적습니다. 예:
text
domain abc.aus.century.com
  1. domain 줄 아래의 빈 줄에 nameserver라는 단어, 공백 하나 이상, 이 호스트가 쓸 이름 서버의 점 10진 인터넷 주소를 적습니다(이름 서버는 domain 문에 적은 도메인을 지원해야 합니다). nameserver 항목은 3개까지 넣을 수 있습니다. 예를 들어 /etc/resolv.conf 파일에 다음 항목이 들어갈 수 있습니다.
text
nameserver 192.9.201.1
nameserver 192.9.201.2

시스템은 나열한 순서대로 이름 서버에 묻습니다.

text
search domainname_list

또는 search 키워드로 리졸버가 도메인 목록에 묻는 순서를 지정할 수 있습니다. 이 경우 domainname_list 값은 abc.aus.century.com과 aus.century.com입니다. domainname_list는 공백으로 구분한 최대 1024자의 문자열입니다(원문 표현은 "1024 character strings").

  1. 이름 서버가 동작한다면 다음 명령으로 호스트와 이름 서버 사이의 통신을 시험할 수 있습니다.
text
host hostname

이름 서버가 풀어야 할 호스트의 이름으로 과정이 동작하는지 봅니다. 결과는 다음과 비슷해야 합니다.

text
brown.abc.aus.century.com is 129.35.145.95

다른 구성 작업은 다음 표와 같습니다.

표 64. 호스트가 이름 서버를 쓰도록 구성하는 작업

작업 SMIT 빠른 경로 명령이나 파일
/etc/resolv.conf 파일 만들기 smit stnamerslv2 /etc/resolv.conf를 만들고 편집(주 1)
호스트가 쓰는 모든 이름 서버 나열 smit lsnamerslv /etc/resolv.conf 보기
이름 서버 더하기 smit mknamerslv /etc/resolv.conf 편집(주 2)
이름 서버 지우기 smit rmnamerslv /etc/resolv.conf 편집
도메인 이름 풀이 쓰기 시작·재시작 smit stnamerslv
도메인 이름 풀이 쓰기 멈추기 smit spnamerslv
도메인 바꾸기·보기 smit mkdomain /etc/resolv.conf 편집
도메인 지우기 smit rmdomain /etc/resolv.conf 편집

Web-based System Manager에서는 Software → Network → TCPIP (IPv4 and IPv6) → TCPIP Protocol Configuration → TCP/IP → Configure TCP/IP → Advanced Methods → DNS로 들어갑니다. 이름 서버를 더하려면 Name Server IP Address 필드에 IP 주소를 넣고 Add → OK를, 지우려면 Name server to search에서 고르고 Delete → OK를 누릅니다. 도메인 이름 풀이를 쓰려면 Enable domain name resolution using Domain Name Service (DNS) 확인란을 고르고(멈추려면 지우고) OK를 누릅니다. 도메인은 Domain name to search에서 더하거나(Add → OK) Domain search list에서 골라 지웁니다(Delete → OK).

관련 정보: netsvc.conf 파일

(원문 표의 주 1, 2는 설명이 따로 없습니다.)

영어 원문

Configuring a host to use a name server

To configure a host to use a name server, use the Web-based System Manager, wsm, or use this procedure.

  1. Create an /etc/resolv.conf file by running the following command:
text
touch /etc/resolv.conf
  1. On the first line of the /etc/resolv.conf file, type the word domain followed by the full name of the domain that this host is in. For example:
text
domain abc.aus.century.com
  1. On any blank line below the domain line, type the word nameserver, followed by at least one space, followed by the dotted decimal Internet address of the name server that this host is to use (the name server must serve the domain indicated by the domain statement). You can have up to 3 name server entries. For example, your /etc/resolv.conf file might contain the entries:
text
nameserver 192.9.201.1
nameserver 192.9.201.2

The system queries the name servers in the order listed.

text
search domainname_list

Alternatively, the search keyword could be used to specify the order in which the resolver will query the domain list. In this case, domainname_list values are abc.aus.century.com and aus.century.com. The domainname_list can have a maximum of 1024 character strings, each separated by a space.

  1. Assuming the name server is operational, you can test the communication between the host and the name server by typing the following command:
text
host hostname

Use the name of a host that should be resolved by the name server to see if the process is working. The output you receive should appear similar to the following:

text
brown.abc.aus.century.com is 129.35.145.95

Other configuration tasks are shown in the following table.

Table 64. Configuring a host to use name server tasks

Task SMIT fast path Command or file
Web-based System Manager Management Environment
Create an /etc/resolv.conf
File smit stnamerslv2 create and edit /etc/resolv.conf1
List All the Name Servers Used
by a Host smit lsnamerslv view /etc/resolv.conf Software —> Network —> TCPIP (IPv4 and IPv6) —> TCPIP Protocol Configuration —> TCP/IP —> Configure TCP/IP —> Advanced Methods —> Hosts File —> Contents of /etc/hosts file.
Add a Name Server smit mknamerslv edit /etc/resolv.conf2 Software —> Network —> TCPIP (IPv4 and IPv6) —> TCPIP Protocol Configuration —> TCP/IP —> Configure TCP/IP —> Advanced Methods —> DNS. In the Name Server IP Address field, type the IP Address. Click Add —> OK.
Remove a Name Server smit rmnamerslv edit /etc/resolv.conf Software —> Network —> TCPIP (IPv4 and IPv6) —> TCPIP Protocol Configuration —> TCP/IP —> Configure TCP/IP —> Advanced Methods —> DNS. Select a name server in Name server to search. Click Delete —> OK.
Start/Restart Using Domain
Name Resolution smit stnamerslv Software —> Network —> TCPIP (IPv4 and IPv6) —> TCPIP Protocol Configuration —> TCP/IP —> Configure TCP/IP —> Advanced Methods —> DNS. Select the Enable domain name resolution using Domain Name Service (DNS) check box. Click OK.
Stop Using Domain Name
Resolution smit spnamerslv Software —> Network —> TCPIP (IPv4 and IPv6) —> TCPIP Protocol Configuration —> TCP/IP —> Configure TCP/IP —> Advanced Methods —> DNS. Clear the Enable domain name resolution using Domain Name Service (DNS) check box. Click OK.
Change/Show the Domain smit mkdomain edit /etc/resolv.conf Software —> Network —> TCPIP (IPv4 and IPv6) —> TCPIP Protocol Configuration —> TCP/IP —> Configure TCP/IP —> Advanced Methods —> DNS. —> Domain name to search. Click Add —> OK.

Table 64. Configuring a host to use name server tasks (continued)

Task SMIT fast path Command or file
Web-based System Manager Management Environment
Remove the Domain smit rmdomain edit /etc/resolv.conf Software —> Network —> TCPIP (IPv4 and IPv6) —> TCPIP Protocol Configuration —> TCP/IP —> Configure TCP/IP —> Advanced Methods —> DNS. Select a domain in the Domain search list. Click Delete —> OK.
Related information
netsvc.conf File

DNS 이름 서버의 동적 영역

named 명령은 동적 갱신을 허용합니다. 클라이언트 기계가 갱신을 보낼 수 있도록 named 데이터베이스와 구성 파일을 구성해야 합니다. 영역은 동적이나 정적으로 설정할 수 있으며 기본은 정적입니다.

영역을 동적으로 만들려면 /etc/named.conf 파일의 그 영역 스탠자에 allow-update 키워드를 더해야 합니다. allow-update 키워드는 갱신을 보낼 수 있는 호스트를 정하는 인터넷 주소 일치 목록을 지정합니다. 자세한 설명과 conf 파일 예는 Files Reference의 named.conf File Format for TCP/IP를 봅니다. 다음 예에서는 모든 호스트가 동적 영역을 갱신할 수 있습니다.

text
zone "abc.aus.century.com" IN {
    type master;
    file "named.abc.data";
    allow-update { any; };
};

영역을 동적으로 표시하면 세 가지 보안 모드를 쓸 수 있습니다.

모드 설명
Unsecured 누구든 언제든 영역의 어떤 정보든 갱신할 수 있습니다. 주의: 이 모드는 권장하지 않습니다. 데이터 손실, 데이터 가로채기, 사용자 불만으로 이어질 수 있습니다. 적어도 보안 없는 영역은 특정 인터넷 주소에서만 갱신하도록 제한해야 합니다.
Controlled 새 정보를 만들고 기존 정보를 바꾸는 것을 허용합니다. 안전한 전환 환경에 가장 쓰기 쉬운 모드일 것입니다. 이 모드에서는 들어오는 모든 갱신에 시각이 붙고 키 서명이 있어야 합니다.
Presecured 기존 정보에 대한 모든 갱신은 비슷한 정보로 바꾸는 것이어야 합니다. 새 정보를 만들 수 없습니다. 이 모드에서도 들어오는 모든 갱신에 시각이 붙고 키 서명이 있어야 합니다.

동적 영역은 기본으로 unsecured 모드입니다. 다른 모드를 쓰려면 /etc/named.conf 파일의 영역 스탠자에서 update-security 키워드 뒤에 controlled나 presecured를 적습니다. 이것이 named 서버에게 그 영역에 쓸 보안 수준을 알려 줍니다. 예:

text
zone "abc.aus.century.com" IN {
    type master;
    file "named.abc.data";
    allow-update { any; };
    update-security controlled;
};

모드를 고르면 실제 데이터 파일을 보안 수준에 맞게 고쳐야 합니다. unsecured 모드에서는 데이터 파일을 "그대로" 씁니다. controlled나 presecured 모드에서는 영역의 이름마다 master 서버/호스트 이름 키 쌍을 만들어야 합니다. nsupdate 명령의 -g 옵션으로 만듭니다. 이 명령은 키 쌍(개인 키와 공개 키)을 만듭니다. 이 키들은 갱신에 진짜 서명을 하는 데 필요합니다. 영역 이름 목록의 키를 모두 만든 뒤 데이터 파일에 더해야 합니다. KEY 형식은 다음과 같습니다.

text
Index    ttl    Class     Type     KeyFlags     Protocol     Algorithm     KeyData
필드 설명
Index 영역에서 데이터를 가리키는 데 쓰는 이름
ttl 이 데이터의 TTL(time-to-live). 선택 필드입니다.
Class 데이터의 클래스. 영역에 따라 다르지만 보통 IN입니다.
Type 레코드 종류. 여기서는 KEY입니다.
KeyFlags named에게 키에 관한 정보를 줍니다. 0x0000은 호스트에 쓰는 일반 키 레코드, 0x0100은 영역 이름에 연결된 키 레코드입니다.
Protocol 쓸 프로토콜. 지금은 0 하나뿐입니다.
Algorithm 키의 알고리즘. 지금은 1 하나뿐이며 MD5 개인/공개 키 인증 방법입니다.
KeyData base64로 나타낸 키. nsupdate 명령은 공개 키와 개인 키를 모두 base64로 만들며, 출력 파일에서 공개 키가 마지막에 나옵니다.

예를 들어 동적 영역의 호스트 이름 보안을 확보하려면, 그 호스트 이름이 든 영역의 영역 파일에 다음과 비슷한 줄을 더해야 합니다.

text
bears    4660    IN    KEY    0x0000    0    1    AQOtg......

이 예는 bears에 KEY 레코드가 정의되어 있음을 나타냅니다. bears를 갱신하려는 사람은 데이터베이스의 공개 키에 맞는 개인 키로 갱신에 서명해야 합니다. nsupdate 명령이 성공하려면 개인 키를 클라이언트의 키 파일(기본 /etc/keyfile)에 두어야 합니다. 형식은 다음과 같습니다.

text
hostname          mastername           base64          key

영역 정의 부분에도 비슷한 KEY 항목이 있어야 합니다. presecured와 controlled 모드 모두 영역 키가 필요하며, 없으면 unsecured 모드로 봅니다. 앞의 bears 예처럼 할 수 있지만, 개인 키는 관리자가 nsupdate 명령의 관리 모드에서 쓰도록 남겨 둡니다.

  1. nsupdate 명령으로 키 쌍을 만들려면 다음을 입력합니다.
text
nsupdate -g -h ZoneName -p ServerName -k AdminKeyFile

이렇게 하면 영역의 키가 만들어집니다. 이 예에서 nsupdate는 nsupdate4에 링크되어 있으며, 다음처럼 링크할 수 있습니다.

text
ln -fs /usr/sbin/nsupdate4 /usr/sbin/nsupdate
  1. 키 쌍의 마지막 키를 영역의 앞부분에 다음처럼 넣습니다.
text
IN     KEY     0x0100  0  1  Key

named.abc.data 파일의 항목은 다음과 같습니다.

text
$TTL 3h    ;3 hour
@ IN    SOA     venus.abc.aus.century.com. gail.zeus.abc.aus.century.com. (
                1       ;serial
                3600    ;refresh
                600     ;retry
                3600000 ;expire
                86400   ;negative caching TTL
)
        IN      NS      venus.abc.aus.century.com.
        IN      KEY     0x0100  0 1 AQPlwHmIQeZzRk6Q/nQYhs3xwnhfTgF/
                        8YlBVzKSoKxVKPNLINnYW0mB7attTcfhHaZZcZr4u/
                        vDNikKnhnZwgn/
venus   IN      A       192.9.201.1
earth   IN      A       192.9.201.5
mars    IN      A       192.9.201.3
  1. 이제 이름 서버를 새로 고치면 영역을 적재할 준비가 됩니다. 영역을 갱신할 클라이언트나 DHCP 서버에 AdminKeyFile을 둡니다. AdminKeyFile에 든 영역 키로 이름 서버에 갱신과 유지 보수 작업을 할 수 있습니다.
영어 원문

Dynamic zones on the DNS name server

The named command allows for dynamic updates. The named database and configuration files need to be configured to allow for client machines to issue updates. A zone can be set to dynamic or static. The default zone is static.

To make a zone dynamic, you must add the keyword allow-update to that zone's stanza in the /etc/named.conf file. The allow-update keyword specifies an Internet address match list that defines hosts allowed to submit updates. See the named.conf File Format for TCP/IP in the Files Reference for more information and a detailed example of a conf file. In the following example, all hosts are allowed to update the dynamic zone:

text
zone "abc.aus.century.com" IN {
    type master;
    file "named.abc.data";
    allow-update { any; };
};

After a zone is marked dynamic, three modes of security can be initiated:

  • Unsecured — Allows anyone at anytime to update any information in the zone. Attention: Use of this mode is not recommended. It can lead to data loss, data interception, and user frustration. At the least, an unsecured zone should be limited to updates only from specific Internet addresses.
  • Controlled — Allows for the creation of new information and the replacement of existing information. This is probably the easiest mode to use for a secure transition environment. This mode also requires that all incoming updates be timestamped and have keyed signatures.
  • Presecured — Requires all updates to existing information be replaced with similar information. Does not allow for the creation of new information. This mode also requires that all incoming updates be timestamped and have keyed signatures.

A dynamic zone defaults to unsecured mode. To use one of the other modes, type controlled or presecured after the keyword update-security in the zone stanza of the /etc/named.conf file. This tells the named server the level of security to use with that zone. For example:

text
zone "abc.aus.century.com" IN {
    type master;
    file "named.abc.data";
    allow-update { any; };
    update-security controlled;
};

After a mode is selected, the actual data files must be modified for your level of security. In unsecured mode, the data files are used "as is." For controlled or presecured mode, you must generate a set of

master server/host name key pairs for each name in the zone. This is done with the nsupdate command using the -g option. This command generates the key pair (a private and a public key). These keys are needed to authentically sign for updates. After generating all the keys for your list of zone names, you need to add them to the data file. The KEY format is as follows:

text
Index    ttl    Class     Type     KeyFlags     Protocol     Algorithm     KeyData

where:

  • Index — Specifies the name used to reference the data in the zone.
  • ttl — Specifies the time-to-live (TTL) for this data. This is an optional field.
  • Class — Specifies the class of the data. This is dependent on the zone, but usually it is IN.
  • Type — Indicates the type of the record. In this case, it is KEY.
  • KeyFlags — Gives named information about the key. 0x0000 defines the typical key record used for a host. 0x0100 defines the key record associated with the zone name.
  • Protocol — Specifies the protocol to use. Currently, there is only one, 0.
  • Algorithm — Specifies the algorithm of the key. Currently, there is only one, 1. This is the MD5 Private/Public authentication method.
  • KeyData — Indicates the key in base64 representation. The nsupdate command generates both the public and private keys in base64 representation. The public key is listed last in the output file.

For example, to ensure security over a host name in a dynamic zone, a line similar to the following needs to be added to the zone file for the zone containing the host name.

text
bears    4660    IN    KEY    0x0000    0    1    AQOtg......

The preceding example indicates that bears has a KEY record defined. Someone wanting to update bears would have to sign his update with the private key matching the public key in the database. For the nsupdate command to succeed, the private key needs to be placed on the client in a keyfile (defaults to /etc/keyfile). It should follow the format:

text
hostname          mastername           base64          key

A similar KEY entry is required in the zone definition section. A zone key is required for both presecured and controlled modes or the mode is considered to be unsecured. This can be done as shown in the previous bears example, but the private key is left for the administrator to use with the nsupdate command's administrative mode.

  1. To generate a key pair using the nsupdate command, type the following:
text
nsupdate -g -h ZoneName -p ServerName -k AdminKeyFile

This generates a key for the zone. In this example, nsupdate is linked to nsupdate4, which can be done by typing the following:

text
ln -fs /usr/sbin/nsupdate4 /usr/sbin/nsupdate
  1. Place the last key of the pair in the beginning section for the zone as follows:
text
IN     KEY     0x0100  0  1  Key

The entry for the named.abc.data file is as follows:

(15줄짜리 예는 위 한글 본문에 그대로 실었습니다.)

  1. The zone is now ready to be loaded by refreshing the name server. Place the AdminKeyFile on the client or DHCP server that is updating the zone. The zone key contained in the AdminKeyFile can be used to apply updates and maintenance operations to the name server.

BIND 9 보안

BIND 9는 named의 보안 수단으로 TSIG(Transaction Signatures)와 SIG(Signatures)를 제공합니다.

BIND 9의 이름 서버는 BIND 8과 마찬가지로 기본으로 권한 영역의 동적 갱신을 허용하지 않습니다.

BIND 9는 주로 서버 사이 통신에 TSIG(Transaction Signatures)를 지원합니다. 영역 전송, notify, 재귀 질의 메시지가 여기에 해당합니다. TSIG는 동적 갱신에도 유용합니다. 동적 영역의 주 서버는 접근 제어로 갱신을 제어해야 하지만, IP 기반 접근 제어로는 부족합니다.

현재의 접근 제어 목록 방식 대신 키 기반 암호화를 쓰면 TSIG로 누가 동적 영역을 갱신할 수 있는지 제한할 수 있습니다. 동적 갱신의 ACL(Access Control List) 방식과 달리, TSIG 키는 이름 서버의 구성 파일을 고치지 않고 다른 갱신자에게 나눠 줄 수 있습니다. 곧 이름 서버가 구성 파일을 다시 읽을 필요가 없습니다.

BIND 9에는 BIND 8에 구현된 키워드가 다 있지는 않다는 점에 주의합니다. 이 예에서는 BIND 8의 간단한 master 구성을 씁니다.

참고: named 9를 쓰려면 named 데몬의 심볼릭 링크를 named9로, nsupdate를 nsupdate9로 다시 링크해야 합니다. 다음 명령을 실행합니다.

  1. ln -fs /usr/sbin/named9 /usr/sbin/named
  2. ln -fs /usr/sbin/nsupdate9 /usr/sbin/nsupdate

다음 단계로 TSIG를 설정합니다.

  1. dnssec-keygen 명령으로 키를 만듭니다.
text
dnssec-keygen -a HMAC-MD5 -b 128 -n HOST keyname
  • HMAC-MD5는 암호화에 쓰는 알고리즘입니다.

    • 128은 쓸 키의 길이(비트 수)입니다.
    • HOST는 공유 키 암호화용 호스트 키를 만드는 데 쓰는 TSIG 키워드입니다.

    다음 명령은

text
dnssec-keygen -a HMAC-MD5 -b 128 -n HOST venus-batman.abc.aus.century.com

다음 두 키 파일을 만듭니다.

text
Kvenus-batman.abc.aus.century.com.+157+35215.key
Kvenus-batman.abc.aus.century.com.+157+35215.private
  • 157은 쓴 알고리즘(HMAC-MD5)입니다.
    • 35215는 지문(fingerprint)으로, 영역마다 키를 여러 개 허용하는 DNSSEC에서 유용합니다.
  1. master 이름 서버의 named.conf에 항목을 넣습니다.
text
// TSIG Key
key venus-batman.abc.aus.century.com. {
        algorithm hmac-md5;
        secret "+UWSvbpxHWFdNwEAdy1Ktw==";
};

HMAC-MD5를 쓴다면 두 키 파일 모두 공유 키를 담고 있으며, 파일의 마지막 항목에 저장됩니다. 공유 비밀 키를 클라이언트에 안전하게 복사할 방법을 찾습니다. 키 파일을 복사할 필요는 없고 공유 비밀 키만 복사하면 됩니다.

Kvenus-batman.abc.aus.century.com.+157+35215.private 파일의 항목은 다음과 같습니다.

text
Private-key-format: v1.2
Algorithm: 157 (HMAC_MD5)
Key: +UWSvbpxHWFdNwEAdy1Ktw==

다음은 master 이름 서버의 named.conf 파일 예입니다. 영역 abc.aus.century.com은 키 venus-batman.abc.aus.century.com을 가진 서버에만 영역 전송과 동적 갱신을 허용합니다. 역방향 영역에도 똑같이 해서 갱신자가 공유 키를 가지게 합니다.

text
// TSIG Key
key venus-batman.abc.aus.century.com. {
        algorithm hmac-md5;
        secret "+UWSvbpxHWFdNwEAdy1Ktw==";
};
options {
        directory "/usr/local/domain";
};
zone "abc.aus.century.com" in {
        type master;
        file "named.abc.data";
        allow-transfer { key venus-batman.abc.aus.century.com.;};
        allow-update{ key venus-batman.abc.aus.century.com.; };
};

이제 영역 전송은 키가 있는 서버로 제한되므로 slave 이름 서버의 named.conf 파일도 고쳐야 합니다. 192.9.201.1(venus.abc.aus.century.com)로 가는 모든 요청은 키로 서명됩니다. 키 이름(venus-batman.abc.aus.century.com.)은 그 키를 쓰는 서버들의 것과 같아야 합니다. 다음은 slave 이름 서버의 named.conf 파일 예입니다.

text
// TSIG Key
key venus-batman.abc.aus.century.com. {
        algorithm hmac-md5;
        secret "+UWSvbpxHWFdNwEAdy1Ktw==";
};
server 192.9.201.1{
        keys { venus-batman.abc.aus.century.com.;};
};
options {
        directory "/usr/local/domain";
};
zone "abc.aus.century.com" IN {
    type slave;
    file "named.abc.data.bak";
    masters { 192.9.201.1; };
};

BIND 9 TSIG(Transaction Signatures)

(원문은 위 내용을 이 소제목 아래에 한 번 더 싣습니다. 내용은 같습니다.)

BIND 9는 주로 서버 사이 통신에 TSIG(Transaction Signatures)를 지원합니다. 영역 전송, notify, 재귀 질의 메시지가 여기에 해당합니다. TSIG는 동적 갱신에도 유용합니다. 동적 영역의 주 서버는 접근 제어로 갱신을 제어해야 하지만, IP 기반 접근 제어로는 부족합니다.

현재의 접근 제어 목록 방식 대신 키 기반 암호화를 쓰면 TSIG로 누가 동적 영역을 갱신할 수 있는지 제한할 수 있습니다. 동적 갱신의 ACL(Access Control List) 방식과 달리, TSIG 키는 이름 서버의 구성 파일을 고치지 않고 다른 갱신자에게 나눠 줄 수 있습니다. 곧 이름 서버가 구성 파일을 다시 읽을 필요가 없습니다.

BIND 9에는 BIND 8에 구현된 키워드가 다 있지는 않다는 점에 주의합니다. 이 예에서는 BIND 8의 간단한 master 구성을 씁니다.

참고: named 9를 쓰려면 named 데몬의 심볼릭 링크를 named9로, nsupdate를 nsupdate9로 다시 링크해야 합니다. 다음 명령을 실행합니다.

  1. ln -fs /usr/sbin/named9 /usr/sbin/named
  2. ln -fs /usr/sbin/nsupdate9 /usr/sbin/nsupdate

다음 단계로 TSIG를 설정합니다.

  1. dnssec-keygen 명령으로 키를 만듭니다.
text
dnssec-keygen -a HMAC-MD5 -b 128 -n HOST keyname
  • HMAC-MD5는 암호화에 쓰는 알고리즘입니다.

    • 128은 쓸 키의 길이(비트 수)입니다.
    • HOST는 공유 키 암호화용 호스트 키를 만드는 데 쓰는 TSIG 키워드입니다.

    다음 명령은

text
dnssec-keygen -a HMAC-MD5 -b 128 -n HOST venus-batman.abc.aus.century.com

다음 두 키 파일을 만듭니다.

text
Kvenus-batman.abc.aus.century.com.+157+35215.key
Kvenus-batman.abc.aus.century.com.+157+35215.private
  • 157은 쓴 알고리즘(HMAC-MD5)입니다.
    • 35215는 지문(fingerprint)으로, 영역마다 키를 여러 개 허용하는 DNSSEC에서 유용합니다.
  1. master 이름 서버의 named.conf에 항목을 넣습니다.
text
// TSIG Key
key venus-batman.abc.aus.century.com. {
         algorithm hmac-md5;
         secret "+UWSvbpxHWFdNwEAdy1Ktw==";
};

HMAC-MD5를 쓴다면 두 키 파일 모두 공유 키를 담고 있으며, 파일의 마지막 항목에 저장됩니다. 공유 비밀 키를 클라이언트에 안전하게 복사할 방법을 찾습니다. 키 파일을 복사할 필요는 없고 공유 비밀 키만 복사하면 됩니다.

Kvenus-batman.abc.aus.century.com.+157+35215.private 파일의 항목은 다음과 같습니다.

text
Private-key-format: v1.2
Algorithm: 157 (HMAC_MD5)
Key: +UWSvbpxHWFdNwEAdy1Ktw==

다음은 master 이름 서버의 named.conf 파일 예입니다. 영역 abc.aus.century.com은 키 venus-batman.abc.aus.century.com을 가진 서버에만 영역 전송과 동적 갱신을 허용합니다. 역방향 영역에도 똑같이 해서 갱신자가 공유 키를 가지게 합니다.

text
// TSIG Key
key venus-batman.abc.aus.century.com. {
         algorithm hmac-md5;
         secret "+UWSvbpxHWFdNwEAdy1Ktw==";
};
options {
         directory "/usr/local/domain";
};
zone "abc.aus.century.com" in {
         type master;
         file "named.abc.data";
         allow-transfer { key venus-batman.abc.aus.century.com.;};
         allow-update{ key venus-batman.abc.aus.century.com.; };
};

이제 영역 전송은 키가 있는 서버로 제한되므로 slave 이름 서버의 named.conf 파일도 고쳐야 합니다. 192.9.201.1(venus.abc.aus.century.com)로 가는 모든 요청은 키로 서명됩니다. 키 이름(venus-batman.abc.aus.century.com.)은 그 키를 쓰는 서버들의 것과 같아야 합니다. 다음은 slave 이름 서버의 named.conf 파일 예입니다.

text
// TSIG Key
key venus-batman.abc.aus.century.com. {
         algorithm hmac-md5;
         secret "+UWSvbpxHWFdNwEAdy1Ktw==";
};
server 192.9.201.1{
         keys { venus-batman.abc.aus.century.com.;};
};
options {
         directory "/usr/local/domain";
};
zone "abc.aus.century.com" IN {
     type slave;
     file "named.abc.data.bak";
     masters { 192.9.201.1; };
};

BIND 9 SIG(Signature)

BIND 9는 RFC 2535에 정의된 DNSSEC SIG 트랜잭션 서명을 일부 지원합니다.

SIG는 공개 키와 개인 키로 메시지를 인증합니다.

SIG 레코드로 관리자는 영역 데이터에 서명해 그 데이터가 진짜임을 밝힐 수 있습니다.

루트 영역 보안하기

이 단계로 루트 영역을 보안할 때는, 인터넷의 다른 이름 서버는 BIND 9를 쓰지 않으며, 내 영역 데이터를 보안하고 다른 서버가 내 영역 데이터를 검증할 수 있게 하려 한다고 가정합니다.

내 영역(이 경우 aus.century.com)이 안전한 루트이며 그 아래의 안전한 영역 데이터를 검증하겠다고 밝히려는 것입니다.

  1. dnssec-keygen 명령으로 키를 만듭니다.
text
dnssec-keygen -a RSA -b 512 -r /usr/sbin/named -n ZONE aus.century.com.

참고: OpenSSL이 설치되어 있으면 키를 만드는 알고리즘으로 RSA 암호화를 쓸 수 있습니다. 다만 먼저 다음 명령으로 DNS 라이브러리를 보안 DNS 라이브러리로 다시 링크해야 합니다.

text
ln -fs /usr/lib/libdns_secure.a /usr/lib/libdns.a
  • ZONE: 개인/공개 키 암호화용 영역 키를 만드는 데 쓰는 DNSSEC 키워드입니다.
    • r 플래그는 난수 장치를 지정합니다.
  1. named.conf 파일에 공개 키 항목을 비슷하게 더합니다. 이 경우 쓴 항목은 다음과 같습니다. 다음은 키 파일 Kaus.century.com.+001+03254.key의 내용입니다.

    abc.aus.century.com. IN KEY 256 3 1 AQOnfGEAg0xpzSdNRe7KePq3Dl4NqQiq7HkwKl6TygUfaw6vz6ldmauB4UQFcGKOyL68/ Zv5ZnEvyB1fMTAaDLYz

    공개 키는 Kzonename.+algor.+fingerprint.key 파일, 이 경우 Kaus.century.com.+001+03254.key에 들어 있습니다. 클래스 IN과 종류 KEY를 지우고 키를 따옴표로 감싸야 합니다. 이 항목을 /etc/named.conf 파일에 더하고 이름 서버를 새로 고치면 영역 aus.century.com이 안전한 루트가 됩니다.

text
trusted-keys {
        aus.century.com. 256 3 1 "AQOnfGEAg0xpzSdNRe7KePq3Dl4NqQiq7HkwKl6Tyg
Ufaw6vz6ldmauB 4UQFcGKOyL68/Zv5ZnEvyB1fMTAaDLYz";
};
options {
        directory "/usr/local/domain";
};
zone "abc.aus.century.com" in {
        type master;
        file "named.abc.data.signed";
        allow-update{192.9.201.1;};
};

신뢰 사슬 적용하기

안전한 루트가 생겼으니 나머지 하위 영역을 보안할 수 있습니다. 이 경우 영역 abc.aus.century.com을 보안합니다.

나머지 하위 영역을 보안하는 단계는 다음과 같습니다.

  1. dnssec-keygen 명령으로 키 쌍을 만듭니다.
text
dnssec-keygen -a RSA -b 512 -r /usr/sbin/named -n ZONE abc.aus.century.com.

r 플래그는 난수 입력 파일을 지정합니다.

  1. dnssec-makekeyset 명령으로 키셋을 만듭니다.
text
dnssec-makekeyset -t 172800 Kabc.aus.century.com.+001+11515.key

Kabc.aus.century.com.+001+11515.key는 내 공개 키입니다. 이 명령은 keyset-abc.aus.century.com이라는 키셋 파일을 만듭니다.

  1. 이 키셋 파일을 부모 영역에 보내 서명을 받습니다. 이 경우 부모 영역은 안전한 루트 영역 aus.century.com입니다.

  2. 부모는 자기 개인 키로 키에 서명해야 합니다.

text
dnssec-signkey keyset-abc.aus.century.com. Kaus.century.com.+001+03254.private

이 명령은 signedkey-abc.aus.century.com이라는 파일을 만들며, 부모는 이 파일을 하위 영역에 돌려보내야 합니다.

  1. 영역 abc.aus.century.com의 하위 이름 서버에서, 일반 영역 파일 named.abc.data에 $INCLUDE Kabc.aus.century.com.+001+11515.key를 더합니다. signedkey-abc.aus.century.com 파일을 영역 파일 named.abc.data와 같은 위치에 두는 것을 잊지 마십시오. 다음 단계에서 영역에 서명할 때 프로그램이 부모에게서 받은 signedkey-abc.aus.century.com을 포함해야 함을 압니다.
text
$TTL 3h    ;3 hour
@ IN    SOA     venus.abc.aus.century.com. gail.zeus.abc.aus.century.com.  (
                1       ;serial
                3600    ;refresh
                600     ;retry
                3600000 ;expire
                86400   ;negative caching TTL
)
$INCLUDE Kabc.aus.century.com.+001+03254.key
  1. dnssec-signzone 명령으로 영역에 서명합니다.
text
dnssec-signzone -o abc.aus.century.com. named.abc.data
  1. 하위 영역 abc.aus.century.com의 named.conf 파일을 새로 서명한 영역 파일(named.abc.data.signed)을 쓰도록 고칩니다. 예:
text
options {
        directory "/usr/local/domain";
};
zone "abc.aus.century.com" in {
        type master;
        file "named.abc.data.signed";
        allow-update{192.9.201.1;};
};
  1. 이름 서버를 새로 고칩니다.

문제 해결에 관한 정보는 TCP/IP 문제 해결의 이름 풀이 문제를 봅니다.

영어 원문

BIND 9 security

BIND 9 offers Transaction Signatures (TSIG) and Signatures (SIG) as security measures for named.

The name server with BIND 9, by default, does not allow dynamic updates to authoritative zones, similarly to that of BIND 8.

BIND 9 primarily supports Transaction Signatures (TSIG) for server-to-server communication. This includes zone transfer, notify, and recursive query messages. TSIG is also useful for dynamic updates. A primary server for a dynamic zone should use access control to control updates, but IP-based access control is insufficient.

By using key base encryption rather than the current method of access control lists, TSIG can be used to restrict who can update to the dynamic zones. Unlike the Access Control List (ACL) method of dynamic updates, the TSIG key can be distributed to other updaters without having to modify the configuration files on the name server, which means there is no need for the name server to reread the configuration files.

It is important to note that BIND 9 does not have all the keywords implemented in BIND 8. In this example, we use the simple master configuration from BIND 8.

Note: To use named 9, you must relink the symbolic link to the named daemon to named9, and

nsupdate to nsupdate9 by running the following commands

  1. ln -fs /usr/sbin/named9 /usr/sbin/named

  2. ln -fs /usr/sbin/nsupdate9 /usr/sbin/nsupdate

  3. Generate the key using the dnssec-keygen command:

text
dnssec-keygen -a HMAC-MD5 -b 128 -n HOST keyname
  • HMAC-MD5 is the algorithm used for encryption

  • 128 is the length of the key to use (or number of bits)

  • HOST: HOST is the TSIG keyword used to generate a host key for shared key encryption. The command

text
dnssec-keygen -a HMAC-MD5 -b 128 -n HOST venus-batman.abc.aus.century.com

would produce two key files, as follows:

text
Kvenus-batman.abc.aus.century.com.+157+35215.key
Kvenus-batman.abc.aus.century.com.+157+35215.private
  • 157 is the algorithm used (HMAC-MD5)

  • 35215 is the finger print, which is useful in DNNSEC because multiple keys per zone are allowed

  1. Add the entry to named.conf on the master name server:
text
// TSIG Key
key venus-batman.abc.aus.century.com. {
        algorithm hmac-md5;
        secret "+UWSvbpxHWFdNwEAdy1Ktw==";
};

Assuming HMAC-MD5 is being used, both keyfiles contain the shared key, which are stored as the last entry in the files. Find a secure way to copy the shared secret key to the client. You do not need to copy the keyfile, just the shared secret key.

Following is the entry for file Kvenus-batman.abc.aus.century.com.+157+35215.private:

text
Private-key-format: v1.2
Algorithm: 157 (HMAC_MD5)
Key: +UWSvbpxHWFdNwEAdy1Ktw==

Below is an example of the named.conf file for the master name server. The zone abc.aus.century.com allows zone transfer and dynamic updates only to servers with the key venus- batman.abc.aus.century.com. Do the same to the reverse zone, which requires updaters to have the shared key.

(14줄짜리 예는 위 한글 본문에 그대로 실었습니다.)

Because zones transfers are now restricted to those that have a key, the slave name server's named.conf file must also be edited. All requests to 192.9.201.1 (venus.abc.aus.century.com) are signed by a key. Note the name of the key (venus-batman.abc.aus.century.com.) must match those on the servers who use them. Below is an example of the named.conf file on the slave name server:

(16줄짜리 예는 위 한글 본문에 그대로 실었습니다.)

BIND 9 Transaction Signatures

BIND 9 primarily supports Transaction Signatures (TSIG) for server-to-server communication.

This includes zone transfer, notify, and recursive query messages. TSIG is also useful for dynamic updates. A primary server for a dynamic zone should use access control to control updates, but IP-based access control is insufficient.

By using key base encryption rather than the current method of access control lists, TSIG can be used to restrict who can update to the dynamic zones. Unlike the Access Control List (ACL) method of dynamic

updates, the TSIG key can be distributed to other updaters without having to modify the configuration files on the name server, which means there is no need for the name server to reread the configuration files.

It is important to note that BIND 9 does not have all the keywords implemented in BIND 8. In this example, we use the simple master configuration from BIND 8.

Note: To use named 9, you must relink the symbolic link to the named daemon to named9, and

nsupdate to nsupdate9 by running the following commands

  1. ln -fs /usr/sbin/named9 /usr/sbin/named

  2. ln -fs /usr/sbin/nsupdate9 /usr/sbin/nsupdate

  3. Generate the key using the dnssec-keygen command:

text
dnssec-keygen -a HMAC-MD5 -b 128 -n HOST keyname
  • HMAC-MD5 is the algorithm used for encryption

  • 128 is the length of the key to use (or number of bits)

  • HOST: HOST is the TSIG keyword used to generate a host key for shared key encryption. The command

text
dnssec-keygen -a HMAC-MD5 -b 128 -n HOST venus-batman.abc.aus.century.com

would produce two key files, as follows:

text
Kvenus-batman.abc.aus.century.com.+157+35215.key
Kvenus-batman.abc.aus.century.com.+157+35215.private
  • 157 is the algorithm used (HMAC-MD5)

  • 35215 is the finger print, which is useful in DNNSEC because multiple keys per zone are allowed

  1. Add the entry to named.conf on the master name server:
text
// TSIG Key
key venus-batman.abc.aus.century.com. {
         algorithm hmac-md5;
         secret "+UWSvbpxHWFdNwEAdy1Ktw==";
};

Assuming HMAC-MD5 is being used, both keyfiles contain the shared key, which are stored as the last entry in the files. Find a secure way to copy the shared secret key to the client. You do not need to copy the keyfile, just the shared secret key. Following is the entry for file Kvenus-batman.abc.aus.century.com.+157+35215.private:

text
Private-key-format: v1.2
Algorithm: 157 (HMAC_MD5)
Key: +UWSvbpxHWFdNwEAdy1Ktw==

What follows is an example of the named.conf file for the master name server. The zone abc.aus.century.com allows zone transfer and dynamic updates only to servers with the key venus-batman.abc.aus.century.com. Do the same to the reverse zone, which requires updaters to have the shared key.

(14줄짜리 예는 위 한글 본문에 그대로 실었습니다.)

Because zones transfers are now restricted to those that have a key, the slave name server's named.conf file must also be edited. All requests to 192.9.201.1 (venus.abc.aus.century.com) are signed by a key. Note the name of the key (venus-batman.abc.aus.century.com.) must match those on the servers who use them. Below is an example of the named.conf file on the slave name server:

(16줄짜리 예는 위 한글 본문에 그대로 실었습니다.)

BIND 9 Signature

BIND 9 partially supports DNSSEC SIG transaction signatures as specified in RFC 2535.

SIG uses public and private keys to authenticate messages.

SIG records allow administers to sign their zone data, thereby stating that it is authentic.

Securing the root zone:

When using these steps to secure the root zone, assume that other name servers on the internet are not using BIND 9, and you want to secure your zone data and allow other servers to verify your zone data.

You want to state that your zone (in our case aus.century.com) is a secure root, and will validate any secure zone data below it.

  1. Generate the keys using the dnssec-keygen command:
text
dnssec-keygen -a RSA -b 512 -r /usr/sbin/named -n ZONE aus.century.com.

Note: RSA encryption can be used as the algorithm to generate the key if OpenSSL is installed, although you must first relink the DNS library to a secured DNS library by running the following command:

text
ln -fs /usr/lib/libdns_secure.a /usr/lib/libdns.a
  • ZONE: ZONE is the DNSSEC keyword used to generate zone keys for private/public key encryption

  • The r flag specifies a random device

  1. Add the public key entry similar to the named.conf file. The entry used in our case follows. Below are the contents of key file Kaus.century.com.+001+03254.key.

abc.aus.century.com. IN KEY 256 3 1 AQOnfGEAg0xpzSdNRe7KePq3Dl4NqQiq7HkwKl6TygUfaw6vz6ldmauB4UQFcGKOyL68/ Zv5ZnEvyB1fMTAaDLYz The public key is contained in the file Kzonename.+algor.+fingerprint.key, or in our case Kaus.century.com.+001+03254.key. You have to remove the class IN and type KEY as well as quote the key. Once you add this entry to the /etc/named.conf file and refresh the name server, the zone aus.century.com is a secure root.

text
trusted-keys {
        aus.century.com. 256 3 1 "AQOnfGEAg0xpzSdNRe7KePq3Dl4NqQiq7HkwKl6Tyg
Ufaw6vz6ldmauB 4UQFcGKOyL68/Zv5ZnEvyB1fMTAaDLYz";
};
options {
        directory "/usr/local/domain";
};
zone "abc.aus.century.com" in {
        type master;
        file "named.abc.data.signed";
        allow-update{192.9.201.1;};
};

Applying the chain of trust:

Now that you have a secured root, you can secure the rest of your child zones. In this case, we are working to secure the zone abc.aus.century.com.

Follow these steps to secure your remaining child zones:

  1. Generate the key pairs using the dnssec-keygen command:
text
dnssec-keygen -a RSA -b 512 -r /usr/sbin/named -n ZONE abc.aus.century.com.

The r flag specifies a random input file.

  1. Make a keyset by running the dnssec-makekeyset command:
text
dnssec-makekeyset -t 172800 Kabc.aus.century.com.+001+11515.key

where Kabc.aus.century.com.+001+11515.key is your own public key. This creates a keyset file called keyset-abc.aus.century.com.

  1. Send this keyset file to the parent zone to get it signed. In this case, our parent zone is the secure root zone aus.century.com.

  2. The parent must sign the key using its private key.

text
dnssec-signkey keyset-abc.aus.century.com. Kaus.century.com.+001+03254.private

This will generate a file called signedkey-abc.aus.century.com, and the parent will need to send this file back to the child zone.

  1. On the child name server for zone abc.aus.century.com, add $INCLUDE Kabc.aus.century.com.+001+11515.key to the plain zone file named.abc.data. Remember to place the signedkey-abc.aus.century.com file in the same location as the zone file named.abc.data. When the zone is signed in the following step, the program will know to include signedkey- abc.aus.century.com, which was received from the parent.
text
$TTL 3h    ;3 hour
@ IN    SOA     venus.abc.aus.century.com. gail.zeus.abc.aus.century.com.  (
                1       ;serial
                3600    ;refresh
                600     ;retry
                3600000 ;expire
                86400   ;negative caching TTL
)
$INCLUDE Kabc.aus.century.com.+001+03254.key
  1. Sign the zone using the dnssec-signzone command:
text
dnssec-signzone -o abc.aus.century.com. named.abc.data
  1. Modify the named.conf file on the child zone abc.aus.century.com to use the new signed zone file (named.abc.data.signed). For example:
text
options {
        directory "/usr/local/domain";
};
zone "abc.aus.century.com" in {
        type master;
        file "named.abc.data.signed";
        allow-update{192.9.201.1;};
};
  1. Refresh the name server.

For information on troubleshooting, see Name resolution problems.