# Bind9
系統:ubuntu server 1804
###### tags: `ubuntu` `dns`
### 0x00 安裝
apt install bind9
### 0x01 設定 named.conf.options
nano /etc/bind/named.conf.options
```
acl "trusted" {
192.168.0.1 #信任ip列表,可以設定本地端
192.168.0.0/24 #網段
};
options {
directory "/var/cache/bind";
recursion no; # enables resursive queries
allow-recursion { trusted; }; # 信任端
listen-on { 192.168.0.1; }; # 監聽ip
allow-transfer { none; }; # disable zone transfers by default
forwarders {
8.8.8.8;
1.1.1.1;
};
};
```
allow-recursion:允許哪些來源可以使用 DNS 主機進行遞迴查詢動作。簡單說就是透過這台 DNS 來查詢任何資料,包含不是該 DNS 主機負責的 zone 也代為查詢
### 註記
在Ubuntu下的設定檔有三個
named.conf.default-zones
named.conf.local
named.conf.options
在CentOS下只有一個設定檔