This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
финальная_настройка_dns_сервера [2015/06/01 11:57] val [FreeBSD] |
финальная_настройка_dns_сервера [2024/12/26 08:41] (current) val [Настройка зоны corpX.un] |
||
---|---|---|---|
Line 2: | Line 2: | ||
===== Настройка сервиса ===== | ===== Настройка сервиса ===== | ||
- | ==== Ubuntu ==== | + | |
+ | ==== Debian/Ubuntu ==== | ||
<code> | <code> | ||
- | root@server:~# apt-get install bind9 | + | root@server:~# apt install bind9 |
root@server:~# cat /etc/bind/named.conf | root@server:~# cat /etc/bind/named.conf | ||
Line 16: | Line 17: | ||
172.16.1.254; | 172.16.1.254; | ||
}; | }; | ||
+ | empty-zones-enable no; | ||
}; | }; | ||
Line 27: | Line 29: | ||
type master; | type master; | ||
file "/etc/bind/corpX.un"; | file "/etc/bind/corpX.un"; | ||
- | }; | ||
- | |||
- | zone "X.168.192.IN-ADDR.ARPA" { | ||
- | type master; | ||
- | file "/etc/bind/corpX.rev"; | ||
}; | }; | ||
}; | }; | ||
Line 41: | Line 38: | ||
}; | }; | ||
}; | }; | ||
- | </code><code> | ||
- | root@server:~# cd /etc/bind/ | ||
</code> | </code> | ||
- | ==== FreeBSD ==== | ||
- | <code> | ||
- | [server:~] # pkg install bind99 | ||
- | [server:~] # cat /usr/local/etc/namedb/named.conf | + | ==== Настройка зоны corpX.un ==== |
- | </code><code> | + | |
- | options { | + | |
- | directory "/usr/local/etc/namedb/working"; | + | |
- | pid-file "/var/run/named/pid"; | + | |
- | + | ||
- | allow-recursion { any; }; | + | |
- | + | ||
- | forwarders { | + | |
- | 172.16.1.254; | + | |
- | }; | + | |
- | }; | + | |
- | + | ||
- | view "inside" { | + | |
- | match-clients { | + | |
- | // 192.168.X/24; | + | |
- | // 127/8; | + | |
- | 0/0; | + | |
- | }; | + | |
- | zone "corpX.un" { | + | |
- | type master; | + | |
- | file "/usr/local/etc/namedb/master/corpX.un"; | + | |
- | }; | + | |
- | + | ||
- | zone "X.168.192.IN-ADDR.ARPA" { | + | |
- | type master; | + | |
- | file "/usr/local/etc/namedb/master/corpX.rev"; | + | |
- | }; | + | |
- | }; | + | |
- | view "outside" { | + | |
- | zone "corpX.un" { | + | |
- | type master; | + | |
- | file "/usr/local/etc/namedb/master/corpX.un.out"; | + | |
- | }; | + | |
- | }; | + | |
- | </code><code> | + | |
- | [server:~] # cd /usr/local/etc/namedb/master/ | + | |
- | </code> | + | |
- | + | ||
- | ==== FreeBSD/Ubuntu ==== | + | |
<code> | <code> | ||
- | server# cat corpX.un | + | server# cat /etc/bind/corpX.un |
</code><code> | </code><code> | ||
$TTL 3h | $TTL 3h | ||
Line 98: | Line 51: | ||
;gate A 192.168.X.1 | ;gate A 192.168.X.1 | ||
;server A 192.168.X.10 | ;server A 192.168.X.10 | ||
- | |||
- | ;lan A 192.168.100+X.10 | ||
;ftp CNAME server | ;ftp CNAME server | ||
Line 116: | Line 67: | ||
;gate A 192.168.X.254 | ;gate A 192.168.X.254 | ||
- | ;_sip._udp SRV 00 00 5060 server | + | ;_sip._udp SRV 0 0 5060 server |
+ | |||
+ | ;_xmpp-client._tcp SRV 0 0 5222 server | ||
;_kerberos._udp SRV 01 00 88 server | ;_kerberos._udp SRV 01 00 88 server | ||
;_kerberos._tcp SRV 01 00 88 server | ;_kerberos._tcp SRV 01 00 88 server | ||
;_kerberos TXT CORPX.UN | ;_kerberos TXT CORPX.UN | ||
- | </code><code> | ||
- | server# cat corpX.rev | ||
- | </code><code> | ||
- | $TTL 3h | ||
- | @ SOA ns.corpX.un. root.ns.corpX.un. 1 1d 12h 1w 3h | ||
- | NS ns.corpX.un. | ||
- | |||
- | |||
- | ;10 PTR server.corpX.un. | ||
- | ;1 PTR gate.corpX.un. | ||
- | |||
- | ;1 PTR router.corpX.un. | ||
- | ;3 PTR switch.corpX.un. | ||
- | ;1 PTR node1.corpX.un. | + | ;$GENERATE 1-100 node$ A 192.168.X.$ |
- | ;2 PTR node2.corpX.un. | + | ;$GENERATE 1-9 node$ A 192.168.X.20$ |
- | ;254 PTR gate.corpX.un. | + | ;$GENERATE 10-54 node$ A 192.168.X.2$ |
+ | ;$GENERATE 1-9 kube$ A 192.168.X.22$ | ||
</code><code> | </code><code> | ||
server# cat corpX.un.out | server# cat corpX.un.out | ||
Line 154: | Line 95: | ||
;mail CNAME server | ;mail CNAME server | ||
- | ;_sip._udp SRV 00 00 5060 server | + | ;_sip._udp SRV 00 00 6050 server |
- | </code><code> | + | </code> |
+ | |||
+ | ===== Тестирование сервиса ===== | ||
+ | |||
+ | <code> | ||
server# named-checkconf -z | server# named-checkconf -z | ||
</code> | </code> | ||
Line 172: | Line 117: | ||
</code> | </code> | ||
- | ==== Ubuntu ==== | + | ==== Debian/Ubuntu ==== |
<code> | <code> | ||
- | root@server:~# /etc/init.d/bind9 restart | + | root@server:~# service bind9 restart |
+ | |||
+ | debian11# service named restart | ||
</code> | </code> | ||
===== Настройки DNS клиентов ===== | ===== Настройки DNS клиентов ===== | ||
<code> | <code> | ||
- | server# cat /etc/resolv.conf | + | # cat /etc/resolv.conf |
</code><code> | </code><code> | ||
- | domain corpX.un | + | search corpX.un |
- | nameserver 127.0.0.1 | + | |
- | </code><code> | + | |
- | gate# cat /etc/resolv.conf | + | |
- | </code><code> | + | |
- | domain corpX.un | + | |
- | nameserver 192.168.X.10 | + | |
- | </code><code> | + | |
- | lan# cat /etc/resolv.conf | + | |
- | </code><code> | + | |
- | domain corpX.un | + | |
nameserver 192.168.X.10 | nameserver 192.168.X.10 | ||
</code> | </code> | ||
- | ===== Проверки (на gate и server) ===== | + | ===== Проверки на ВСЕХ системах ===== |
<code> | <code> | ||
+ | # host ns | ||
+ | |||
# host ya.ru | # host ya.ru | ||
- | # host gate.corpX.un | ||
- | # host server.corpX.un | ||
- | # host 192.168.X.10 | ||
- | # host 192.168.X.1 | ||
</code> | </code> | ||
Line 240: | Line 175: | ||
corp12 NS ns12 | corp12 NS ns12 | ||
... | ... | ||
+ | </code> | ||
+ | |||
+ | ==== FreeBSD ==== | ||
+ | <code> | ||
+ | [server:~] # pkg install bind99 | ||
+ | |||
+ | [server:~] # cat /usr/local/etc/namedb/named.conf | ||
+ | </code><code> | ||
+ | options { | ||
+ | directory "/usr/local/etc/namedb/working"; | ||
+ | pid-file "/var/run/named/pid"; | ||
+ | |||
+ | allow-recursion { any; }; | ||
+ | | ||
+ | forwarders { | ||
+ | 172.16.1.254; | ||
+ | }; | ||
+ | }; | ||
+ | |||
+ | view "inside" { | ||
+ | match-clients { | ||
+ | // 192.168.X/24; | ||
+ | // 127/8; | ||
+ | 0/0; | ||
+ | }; | ||
+ | zone "corpX.un" { | ||
+ | type master; | ||
+ | file "/usr/local/etc/namedb/master/corpX.un"; | ||
+ | }; | ||
+ | }; | ||
+ | |||
+ | view "outside" { | ||
+ | zone "corpX.un" { | ||
+ | type master; | ||
+ | file "/usr/local/etc/namedb/master/corpX.un.out"; | ||
+ | }; | ||
+ | }; | ||
</code> | </code> |