Bind 9.9 二進位Salve zone檔案格式

2016112316:32

BIND 9.9 起,Slave zone 檔案內定為二進位格式

修改 /etc/named.conf

加上 masterfile-format text; 即可

例如

zone "abc.com.tw" {
        type slave;
        file "named.abc.com.tw";
        masterfile-format text;
        masters { 107.167.1.1; };
};



另外,將 二進位 zone 檔案 轉成文字檔的方式:

named-compilezone -f raw -F text -o named.abc.com.tw.txt abc.com.tw named.abc.com.tw
   * named.abc.com.tw 二進位檔
   * named.abc.com.tw.txt 匯出的文字檔




如何查詢 Bind 版本

$ nslookup -q=txt -class=chaos version.bind 103.29.xx.xx
Server:         103.29.xx.xx
Address:        103.29.xx.xx#53

version.bind    text = "9.9.4-RedHat-9.9.4-29.el7_2.4"


$ dig txt chaos version.bind @103.29.xx.xx

; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.47.rc1.el6_8.1 <<>> txt chaos version.bind @103.29.70.73
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 8462
;; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 0
;; WARNING: recursion requested but not available

;; QUESTION SECTION:
;version.bind.                  CH      TXT

;; ANSWER SECTION:
version.bind.           0       CH      TXT     "9.9.4-RedHat-9.9.4-29.el7_2.4"

;; AUTHORITY SECTION:
version.bind.           0       CH      NS      version.bind.

;; Query time: 5 msec
;; SERVER: 103.29.70.73#53(103.29.70.73)
;; WHEN: Thu Nov 24 17:14:11 2016
;; MSG SIZE  rcvd: 86



修改(或隱藏) Bind 版本

修改 /etc/named.conf

options { 
  ...
   version "12345.123";
  ...
};


查詢結果
$ nslookup -q=txt -class=chaos version.bind 103.29.xx.xx
Server:         103.29.xx.xx
Address:        103.29.xx.xx#53

version.bind    text = "12345.123"