This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
сервис_dns [2020/08/30 18:28] val [Ограничение доступа к DNS серверу] |
сервис_dns [2024/07/30 15:02] (current) val [Сервис DNS] |
||
---|---|---|---|
Line 3: | Line 3: | ||
* [[http://ru.wikipedia.org/wiki/DNS|Domain Name System — система доменных имён]] | * [[http://ru.wikipedia.org/wiki/DNS|Domain Name System — система доменных имён]] | ||
* [[http://xgu.ru/wiki/Настройка_DNS-сервера_BIND|Настройка DNS-сервера BIND]] | * [[http://xgu.ru/wiki/Настройка_DNS-сервера_BIND|Настройка DNS-сервера BIND]] | ||
+ | |||
* [[Финальная настройка DNS сервера]] | * [[Финальная настройка DNS сервера]] | ||
+ | * [[https://nip.io/|Dead simple wildcard DNS for any IP Address]] | ||
===== Утилиты тестирования DNS ===== | ===== Утилиты тестирования DNS ===== | ||
Line 11: | Line 13: | ||
==== nslookup ==== | ==== nslookup ==== | ||
<code> | <code> | ||
+ | $ nslookup | ||
+ | >ya.ru | ||
+ | |||
$ nslookup mx.bmstu.ru | $ nslookup mx.bmstu.ru | ||
Line 16: | Line 21: | ||
$ nslookup -q=NS bmstu.ru | $ nslookup -q=NS bmstu.ru | ||
+ | |||
+ | val@noc:~$ nslookup -q=AXFR bmstu.ru 195.19.32.2 | ||
$ nslookup -q=MX bmstu.ru 195.19.32.2 | $ nslookup -q=MX bmstu.ru 195.19.32.2 | ||
- | $ nslookup -q=AXFR bmstu.ru 195.19.32.2 | + | $ nslookup -q=SRV _xmpp-client._tcp.bmstu.ru |
+ | |||
+ | $ nslookup -q=SRV _kerberos._udp.bmstu.ru | ||
- | # nslookup -q=SRV _xmpp-client._tcp.valtest.bmstu.ru | + | $ nslookup -q=SRV _sip._udp.bmstu.ru |
</code> | </code> | ||
Line 122: | Line 131: | ||
==== Настройка сервера перенаправляющего запросы на DNS cервер провайдера ==== | ==== Настройка сервера перенаправляющего запросы на DNS cервер провайдера ==== | ||
- | === FreeBSD === | + | === Debian/Ubuntu === |
<code> | <code> | ||
- | server# cat named.conf | + | root@server:~# cat /etc/bind/named.conf.options |
</code><code> | </code><code> | ||
- | options { | ||
... | ... | ||
forwarders { | forwarders { | ||
Line 132: | Line 140: | ||
}; | }; | ||
... | ... | ||
- | }; | + | // dnssec-validation auto; |
... | ... | ||
+ | }; | ||
</code><code> | </code><code> | ||
- | [server:~] # named-checkconf | + | root@server:~# named-checkconf |
- | [server:~] # service named restart | + | root@server:~# service bind9 restart |
</code> | </code> | ||
- | === Debian/Ubuntu === | + | === FreeBSD === |
<code> | <code> | ||
- | root@server:~# cat /etc/bind/named.conf.options | + | server# cat named.conf |
</code><code> | </code><code> | ||
+ | options { | ||
... | ... | ||
forwarders { | forwarders { | ||
172.16.1.254; | 172.16.1.254; | ||
}; | }; | ||
- | ... | ||
- | // dnssec-validation auto; | ||
... | ... | ||
}; | }; | ||
+ | ... | ||
</code><code> | </code><code> | ||
- | root@server:~# named-checkconf | + | [server:~] # named-checkconf |
- | root@server:~# service bind9 restart | + | [server:~] # service named restart |
</code> | </code> | ||
- | |||
==== Настройка мастер сервера зоны corpX.un ==== | ==== Настройка мастер сервера зоны corpX.un ==== | ||
Line 181: | Line 189: | ||
;www CNAME server | ;www CNAME server | ||
;user1 CNAME server | ;user1 CNAME server | ||
- | ;smtp CNAME server | + | ;mail CNAME server |
- | ;imap CNAME server | + | |
- | ;pop3 CNAME server | + | ;ntp CNAME gate |
- | ;ntp CNAME gate | + | ;proxy A 172.16.1.X |
+ | |||
+ | ;$GENERATE 1-100 node$ A 192.168.X.$ | ||
+ | ;$GENERATE 1-9 node$ A 192.168.X.20$ | ||
+ | ;$GENERATE 10-54 node$ A 192.168.X.2$ | ||
+ | ;$GENERATE 1-9 kube$ A 192.168.X.22$ | ||
;_sip._udp SRV 0 0 5060 server | ;_sip._udp SRV 0 0 5060 server | ||
+ | |||
;_xmpp-client._tcp SRV 0 0 5222 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 | ||
- | ;_kpasswd._udp SRV 01 00 464 server | ||
- | ;_kerberos-adm._tcp SRV 01 00 749 server | ||
;_kerberos TXT CORPX.UN | ;_kerberos TXT CORPX.UN | ||
</code><code> | </code><code> | ||
Line 211: | Line 223: | ||
root@server:~# named-checkconf -z | root@server:~# named-checkconf -z | ||
- | root@server:~# service bind9 restart | + | root@server:~# rndc reload |
</code> | </code> | ||
Line 349: | Line 361: | ||
Создание файла зоны corpX.un для внутренних и внешних пользователей | Создание файла зоны corpX.un для внутренних и внешних пользователей | ||
- | === FreeBSD === | + | === Debian/Ubuntu === |
<code> | <code> | ||
- | [server:~] # cd /usr/local/etc/namedb/master/ | + | server# cat /etc/bind/corpX.un |
- | </code> | + | |
- | + | ||
- | === Ubuntu === | + | |
- | <code> | + | |
- | root@server:~# cd /etc/bind/ | + | |
- | </code> | + | |
- | + | ||
- | === FreeBSD/Ubuntu === | + | |
- | <code> | + | |
- | server# cat corpX.un | + | |
</code><code> | </code><code> | ||
$TTL 3h | $TTL 3h | ||
Line 369: | Line 371: | ||
MX 1 server | MX 1 server | ||
+ | | ||
+ | A 192.168.X.10 | ||
ns A 192.168.X.10 | ns A 192.168.X.10 | ||
server A 192.168.X.10 | server A 192.168.X.10 | ||
gate A 192.168.X.1 | gate A 192.168.X.1 | ||
+ | |||
... | ... | ||
</code><code> | </code><code> | ||
- | server# cat corpX.un.out | + | server# cat /etc/bind/corpX.un.out |
</code><code> | </code><code> | ||
$TTL 3h | $TTL 3h | ||
Line 384: | Line 389: | ||
MX 1 server | MX 1 server | ||
- | + | ||
+ | A 172.16.1.X | ||
+ | | ||
ns A 172.16.1.X | ns A 172.16.1.X | ||
server A 172.16.1.X | server A 172.16.1.X | ||
gate A 172.16.1.X | gate A 172.16.1.X | ||
- | ... | + | |
+ | mail CNAME server | ||
+ | ;... | ||
</code> | </code> | ||
Настройка сервера | Настройка сервера | ||
- | === FreeBSD === | ||
- | <code> | ||
- | server# named.conf | ||
- | </code><code> | ||
- | options { | ||
- | ... | ||
- | }; | ||
- | view "inside" { | ||
- | match-clients { | ||
- | 192.168.X/24; | ||
- | 127/8; | ||
- | }; | ||
- | zone "corpX.un" { | ||
- | type master; | ||
- | file "/usr/local/etc/namedb/master/corpX.un"; | ||
- | }; | ||
- | zone "X.168.192.IN-ADDR.ARPA" { | + | === Debian/Ubuntu === |
- | 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:~] # service named reload | + | |
- | </code> | + | |
- | + | ||
- | === Ubuntu === | + | |
<code> | <code> | ||
- | root@server:~# cat /etc/bind/named.conf.local | + | root@server:~# less /etc/bind/named.conf.local |
</code><code> | </code><code> | ||
zone "corpX.un" { | zone "corpX.un" { | ||
Line 530: | Line 508: | ||
... | ... | ||
}; | }; | ||
+ | </code><code> | ||
+ | gate.isp.un$ nslookup -q=AXFR corpX.un 192.168.X.10 | ||
</code> | </code> | ||
- | |||