본문 바로가기

네임서버

[네임서버] bind 슬레이브 ZONE 파일 유형 변경(masterfile-format)

반응형

bind 슬레이브 ZONE 파일 유형 변경(data -> ASCII text)

슬레이브 서버 named 설정 파일에 적용

vim /etc/named.conf
options {
...
	masterfile-format text;
...
}

 

Syntax:  [ masterfile-format (text|raw) ; ]

masterfile-format
Specifies the file format of zone files (see Section 6.3.7). The default value is text, which is the standard textual representation, except for slave zones, in which the default value is raw. Files in other formats than text are typically expected to be generated by the namedcompilezone tool, or dumped by named.
Note that when a zone file in a different format than text is loaded, named may omit some of the checks which would be performed for a file in the text format. In particular, check-names checks do not apply for the raw format. This means a zone file in the raw format must be generated with the same check level as that specified in the named configuration file. This statement sets the masterfile-format for all zones, but can be overridden on a per-zone or per-view basis by including a masterfile-format statement within the zone or view block in the configuration file.

masterfile-format 적용 전

$ cat mocha.sangchul.kr.zone

file mocha.sangchul.kr.zone
$ file mocha.sangchul.kr.zone 
mocha.sangchul.kr.zone: data

masterfile-format 적용 후

- named.conf : masterfile-format text

$ cat mocha.sangchul.kr.zone 
$ORIGIN .
$TTL 60 ; 1 minute
mocha.sangchul.kr       IN SOA  mocha.sangchul.kr. root.mocha.sangchul.kr. (
                                2023011601 ; serial
                                86400      ; refresh (1 day)
                                3600       ; retry (1 hour)
                                604800     ; expire (1 week)
                                10800      ; minimum (3 hours)
                                )
                        NS      ns.mocha.sangchul.kr.
                        NS      ns2.mocha.sangchul.kr.
                        A       192.168.0.61
$ORIGIN mocha.sangchul.kr.
ns                      A       192.168.0.62
ns2                     A       192.168.0.63
www                     CNAME   mocha.sangchul.kr.
$ file mocha.sangchul.kr.zone 
mocha.sangchul.kr.zone: ASCII text
728x90
반응형