Обновляем список пакетов:
# opkg update |
Устанавливаем сервер и инструменты управления
# opkg install bind-server bind-tools |
В /opt/etc/init.d/S09named добавляем к строке ARGS= параметр -4 и получаем
ARGS="-4 -c /opt/etc/bind/named.conf" |
Удаляем стандартный конфиг bind (/opt/etc/bind/named.conf) и заменяем его на свой (приводим конфигурацию bind как в debian):
named.conf
// This is the primary configuration file for the BIND DNS server named. include "/opt/etc/bind/named.conf.options"; include "/opt/etc/bind/named.conf.local"; include "/opt/etc/bind/named.conf.default-zones"; |
Создаем дополнительные файлы named.conf.options, named.conf.local, named.conf.default-zones в /opt/etc/bind/
# cd /opt/etc/bind/ # touch named.conf.options # touch named.conf.local # touch named.conf.default-zones |
named.conf.options
acl sever.lan {192.168.4.0/24; 127.0.0.1; };
options {
directory "/opt/tmp";
// If your ISP provided one or more IP addresses for stable
// nameservers, you probably want to use them as forwarders.
// Uncomment the following block, and insert the addresses replacing
// the all-0's placeholder.
// forwarders {
// 0.0.0.0;
// };
allow-query { sever.lan; };
auth-nxdomain no; # conform to RFC1035
}; |
named.conf.local
zone "sever.lan" {
type master;
file "/opt/etc/bind/db.sever.lan";
allow-query { any; };
};
zone "4.168.192.in-addr.arpa" {
type master;
file "/opt/etc/bind/4.168.192.in-addr.arpa.zone";
}; |
named.conf.default-zones
// prime the server with knowledge of the root servers
zone "." {
type hint;
file "/opt/etc/bind/db.root";
};
// be authoritative for the localhost forward and reverse zones, and for
// broadcast zones as per RFC 1912
zone "localhost" {
type master;
file "/opt/etc/bind/db.local";
};
zone "127.in-addr.arpa" {
type master;
file "/opt/etc/bind/db.127";
};
zone "0.in-addr.arpa" {
type master;
file "/opt/etc/bind/db.0";
};
zone "255.in-addr.arpa" {
type master;
file "/opt/etc/bind/db.255";
}; |
Создаем файлы для нашей зоны db.sever.lan, 4.168.192.in-addr.arpa.zone
# touch db.sever.lan # touch 4.168.192.in-addr.arpa.zone |
db.sever.lan
$TTL 30
$ORIGIN sever.lan.
@ IN SOA sever.sever.lan. admin.sever.lan. (
2015072201 ;Serial
1d ;Refresh
1h ;Retry
1w ;Expire
2h ) ;Negative Cache TTL
;
@ IN NS sever.sever.lan.
@ IN A 192.168.4.1
sever IN A 192.168.4.1
dns IN A 192.168.4.1
sever-srv IN A 192.168.4.100
siluet-srv IN A 192.168.4.101
siluet-cl IN A 192.168.4.4
applications IN A 192.168.4.110 |
4.168.192.in-addr.arpa.zone
$TTL 30
$ORIGIN 4.168.192.in-addr.arpa.
@ IN SOA sever.sever.lan. admin.sever.lan. (
2015072201 ;Serial
1d ;Refresh
1h ;Retry
1w ;Expire
2h) ;Negative Cache TTL
;
NS sever.sever.lan.
1 PTR dns.sever.lan.
100 PTR sever-srv.sever.lan.
101 PTR siluet-srv.sever.lan.
4 PTR siluet-cl.sever.lan.
110 PTR applications.sever.lan |
Создаем конфиг rndc.key:
# rndc-confgen >> /opt/etc/rndc.key |
Если сделать
# rndc reload
будет ругаться на options, пока не ясно почему.
Становимся сами себе dns-сервером, т.е делаем так, чтобы в /tmp/resolv.conf всегда было
nameserver 127.0.0.1 |
Это можно сделать через web-интерфейс. Установить 127.0.0.1 как dns-сервер на внешнем интерфейсе.
Или сделать
# nvram set wan_dns_t=127.0.0.1 # nvram commit

