get start bind online

Для примера, используется Ubuntu Server 16.04 LTS. Инструкция во многом подойдет для дистрибутивов Linux, основанных на Debian.

Подготовка системы

Если в системе настроен брандмауэр, добавляем правило на разрешение входящих пакетов на 53 UDP-порт:

iptables -I INPUT 1 -p udp —dport 53 -j ACCEPT

* данной командой мы вставляем первое правило на разрешение 53 порта по протоколу UDP.

Установка и запуск

Устанавливаем DNS-сервер следующей командой:

apt-get install bind9 dnsutils

Добавляем сервис в автозапуск:

systemctl enable bind9

* или для старых систем, где нет systemd update-rc.d bind9 defaults.

systemctl start bind9

* или service bind9 start.

Проверяем, что сервис работает:

nslookup dmosk.ru 127.0.0.1

Получаем, что-то на подобие:

Server: 127.0.0.1
Address: 127.0.0.1#53

Non-authoritative answer:
Name: dmosk.ru
Address: 90.156.242.197

Базовая настройка

Основной конфигурационный файл находится по пути /etc/bind/named.conf. В последних версиях bind в нем ничего не настраивается, а используются подключаемые файлы.

По умолчанию, сервер разрешает только локальные запросы. Чтобы разрешить обращаться к серверу, открываем конфигурационный файл:

И добавляем строку:

* в данном примере будут разрешены запросы для всех клиентов (внутренних и внешних). Вместо any можно прописать конкретные сети или IP-адреса.

Если необходимо настроить сервер только для локальной сети, настройка будет следующей:

* где 192.168.0.0/24 — используемая локальная сеть.

Если необходимо перенаправлять запросы на определенный сервер DNS, добавляем строку:

* в данном примере запросы будут перенаправляться на сервер 77.88.8.8 и если они не будут обработаны — на 8.8.8.8.

systemctl restart bind9

* или service bind9 restart.

На этом базовая настройка закончена. Наш сервер готов принимать и отдавать запросы и работать, как кэширующий dns.

Проверить его работу можно с удаленного компьютера Windows или Linux командой:

nslookup ubuntu.com 192.168.0.15

* где 192.168.0.15 — адрес сервера в локальной сети.

Создание и настройка зон

Если необходимо, чтобы bind разрешал записи для собственного домена, необходимо создать соответствующую зону.

Всё о Интернете, сетях, компьютерах, Windows, iOS и Android

Как запустить или перезапустить BIND DNS сервис (Named)

Эту инструкцию я делаю как шпаргалку для себя на тему как запустить DNS-сервис BIND (он же Named), перезапустить или остановить его при необходимости. Надеюсь, что она сможет пригодиться и ещё кому-то.
BIND (Berkeley Internet Name Domain) — это открытая и очень популярная реализация DNS-сервера, которая обеспечивает выполнение преобразования DNS-имени в IP-адрес и наоборот. Она по праву считается самой первой системой ДНС и на сегодняшний день так же не теряет актуальность.

Для того, чтобы выполнять манипуляции с сервисом БИНД, необходимо зайти в систему с правами суперпользователя root. Вводим следующие команды:

Запуск DNS сервера Named

Эти базовые команды позволяют запустить сервис BIND из терминала Linux:

Остановка сервиса Named

Основные команды позволяют запустить сервис BIND из терминала Linux:

Как перезапустить BIND

Для того, чтобы перезагрузить Named и перезапустить сервис — выполните в консоли следующие команды:

Для того, чтобы посмотреть текущий статус работы DNS-сервера БИНД можно использовать такие команды:

Итак, мы с Вами рассмотрели самые основные команды для управления DNS-сервером Bind.

Linux and Unix tutorials for new and seasoned sysadmin

Linux and Unix tutorials for new and seasoned sysadmin

Adblock detected ��

[a] service service-name command.

[b] /etc/init.d/service-name script command.

[c] rndc command – Name server control utility.

CentOS / RHEL / Fedora Linux

Type the following command to start BIND server:
# service named start
Type the following command to stop BIND server:
# service named stop
Type the following command to restart BIND server:
# service named restart
Type the following command to reload BIND server to reload zone file or config file changes:
# service named reload
Type the following command to see the current status of BIND server:
# service named status
You can also use the following syntax too:

/etc/init.d/named start /etc/init.d/named stop /etc/init.d/named restart

Debian / Ubuntu Linux

Type the following command to start BIND server:
# service bind9 start
Type the following command to stop BIND server:
# service bind9 stop
Type the following command to restart BIND server:
# service bind9 restart
Type the following command to reload BIND server to reload zone file or config file changes:
# service bind9 reload
Type the following command to see the current status of BIND server:
# service bind9 status
Sample outputs:
Fig.01: BIND 9 Service In Action
You can also use the following syntax too:

/etc/init.d/bind9 start /etc/init.d/bind9 stop /etc/init.d/bind9 restart /etc/init.d/bind9 status

A note about rncd command

This is an optional command and you are recommended to use the above commands only. From the rndc man page:

rndc controls the operation of a name server. It supersedes the ndc utility that was provided in old BIND releases. If rndc is invoked with no command line options or arguments, it prints a short summary of the supported commands and the available options and their arguments. rndc communicates with the name server over a TCP connection, sending commands authenticated with digital signatures. In the current versions of rndc and named, the only supported authentication algorithm is HMAC-MD5, which uses a shared secret on each end of the connection. This provides TSIG-style authentication for the command request and the name server’s response. All commands sent over the channel must be signed by a key_id known to the server. rndc reads a configuration file to determine how to contact the name server and decide what algorithm and key it should use.

Please note that rndc does not yet support all the commands of the BIND 8 ndc utility:

  1. status – Display status of the server.
  2. stop – Save pending updates to master files and stop the server.
  3. restart – Restart the server.
  4. reload – Reload configuration file and zones.

To see status, enter:
# rndc status
Sample outputs:

To reload the server, enter:
# rndc reload
To see all options just type rncd:
# rndc
Sample outputs:

Usage: rndc [-b address] [-c config] [-s server] [-p port] [-k key-file ] [-y key] [-V] command command is one of the following: reload Reload configuration file and zones. reload zone [ >

Posted by: Vivek Gite

The author is the creator of nixCraft and a seasoned sysadmin, DevOps engineer, and a trainer for the Linux operating system/Unix shell scripting. Get the latest tutorials on SysAdmin, Linux/Unix and open source topics via RSS/XML feed or weekly email newsletter.

Your support makes a big difference:

I have a small favor to ask. More people are reading the nixCraft. Many of you block advertising which is your right, and advertising revenues are not sufficient to cover my operating costs. So you can see why I need to ask for your help. The nixCraft takes a lot of my time and hard work to produce. If everyone who reads nixCraft, who likes it, helps fund it, my future would be more secure. You can donate as little as $1 to support nixCraft:

1 comment

Found problem with bind. It runs for weeks without problems, then slowly over a period of a few hours, it takes longer and longer to resolve, and at certain stage it just stops giving back answers. If one restart bind, problem immediately goes away and all is well for another few weeks. Looking at /var/log/syslog gives no clue why bind is doing this. Server has plenty of diskspace and memory free. I noticed on the net a few other people reported the same problem. Does anybody have a clue why this is happening?

Оцените статью