DNS server за 5 минут на FreeBSD

Конечно, сразу нужно сказать, что речь идет об установке и самой базовой настройке, такая конфигурация DNS сервера может быть использована в тестовой среде, при развертывании сети и прочее и мы крайне не рекомендуем эксплуатировать сервис в таком виде без дополнительных настроек, согласно документации, хоть в итоге Вы и получите работающий DNS сервис который будет преобразовывать доменные имена в ip адреса.

Смотри какие пакеты доступны

root@ns2:/home/user # pkg search bind
R-cran-abind-1.4.5_3           Combine Multidimensional Arrays
R-cran-bindr-0.1.1_3           Parametrized Active Bindings
R-cran-bindrcpp-0.2.2_3        Rcpp Interface to Active Bindings
bind-tools-9.16.18             Command line tools from BIND: delv, dig, host, nslookup...
bind9-devel-9.17.15.a0.2021.06.28 BIND DNS suite with updated DNSSEC and DNS64
bind911-9.11.33                BIND DNS suite with updated DNSSEC and DNS64
bind916-9.16.18                BIND DNS suite with updated DNSSEC and DNS64
bind_exporter-0.4.0            Prometheus exporter for BIND server statistics
bindgraph-0.3_1                RRDtool frontend for BIND statistics
bindtest-1.56_1                Test bind() semantics of IPv6 sockets
fusefs-bindfs-1.14.8           FUSE based bindfs implementation way more powerful than nullfs
go-bindata-3.1.3               Generates Go code from any file
go-bindata-assetfs-1.0.1       Serves embedded files from go-bindata with Go's net/http support
keybinder-0.3.1_5              Library for registering keyboard shortcuts
keybinder-gtk3-0.3.2_1         Library for registering keyboard shortcuts
libbind-6.0_1                  Standard C resolver library
libindicator-12.10.1           Symbols and convience functions for desktop indicators
luabind-0.9.1_16               Library that helps you create bindings between C++ and Lua
nsgenbind-0.8                  NetSurf Generator for JavaScript bindings
p5-BIND-Conf_Parser-0.95_1     Perl5 module to parse BIND 8 configuration files
p5-BIND-Config-Parser-0.01_1   Parse BIND Config files
p5-Catalyst-Controller-BindLex-0.03_2 Stash your lexical goodness
p5-Data-Bind-0.30_2            Perl module to bind and alias variables
p5-Regexp-Bind-0.05_1          Bind variables to captured buffers
p5-Text-Bind-0.04_1            Bind Perl structures to text files
py38-pybind11-2.6.2            Seamless interoperability between C++11 and Python
pybind11-2.6.2                 Seamless interoperability between C++11 and Python (cmake part)
redland-bindings-1.0.17.1_3    Language bindings for the Redland package
rubygem-apipie-bindings-0.4.0  Ruby bindings for API calls that are documented with Apipie
rubygem-bindata-2.4.10         Ruby library to read and write binary file formats
rubygem-bindex-0.8.1           Bindings for your Ruby exceptions
rubygem-binding_of_caller-1.0.0 Retrieve the binding of a methods caller
rust-bindgen-0.58.1_2          Generate Rust bindings from C (and some C++) code
rust-cbindgen-0.19.0_2         Generate C bindings from Rust code
socketbind-1                   Library to bind applications on multihomed machines to specific IP address
vbindiff-3.0.b5                Visual binary diff, visually compare binary files
xapian-bindings-1.4.18         Bindings allowing Xapian to be used from various programming languages
xapian-bindings12-1.2.25_3     Bindings allowing Xapian to be used from various programming languages
xbindkeys-1.8.6_2              Allows you to launch shell commands under X with your keyboard
xkbind-2010.05.20              Minimal keyboard layout indicator program

Для установки из пакета доступна версия bind916-9.16.18. Устанавливаем ее

root@ns2:/home/user # pkg install bind916
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following 14 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
        bind-tools: 9.16.18
        bind916: 9.16.18
        fstrm: 0.6.1
        json-c: 0.15_1
        libedit: 3.1.20210216,1
        libevent: 2.1.12
        libidn2: 2.3.1
        libunistring: 0.9.10_1
        libuv: 1.41.0
        lmdb: 0.9.28,1
        protobuf: 3.14.0,1
        protobuf-c: 1.4.0
        py38-ply: 3.11
        py38-setuptools: 57.0.0

Number of packages to be installed: 14

В конце установки BIND предлагает запустить скрипт

root@ns2:/home/user # rndc-confgen -a
wrote key file "/usr/local/etc/namedb/rndc.key"

Внести дополнительные настройки можно в файл конфигурации /usr/local/etc/namedb/named.conf

После внесения изменений необходимо выполнить проверку конфигурации

root@ns2:/home/user # named-checkconf

Включаем автостарт сервиса при загрузке

root@ns2:/home/user # echo 'named_enable="YES"' >> /etc/rc.conf

Запускаем его

root@ns2:/home/user # service named start
Starting named.

Теперь нам остается проверить работу BIND и посмотреть преобразует ли он доменные имена в ip адреса. Сделать это можно командой

nslookup domainname ip_address_dns_server

где ip_address_dns_server — ip адрес DNS сервера в локальной сети, domainname — любое существующее доменное имя

Проверяем с соседнего компьютера в локальной сети

user@PC47:~$ nslookup google.com 192.168.1.2
Server:         192.168.1.2
Address:        192.168.1.2#53

Non-authoritative answer:
Name:   google.com
Address: 172.217.18.78
Name:   google.com
Address: 2a00:1450:400d:809::200e

Видим что для доменного имени получен ip адрес — сервис работает

 

 

Weather        SpeedTest        Blog        vb76.com        ©vb76