dnsmasq не удалось запустить на Debian

dnsmasq не удалось запустить на Debian

Вот содержимое systemctl status dnsmasq.service:

● dnsmasq.service - dnsmasq - A lightweight DHCP and caching DNS server
   Loaded: loaded (/lib/systemd/system/dnsmasq.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Sat 2019-06-29 12:37:37 CEST; 23s ago
  Process: 24641 ExecStart=/etc/init.d/dnsmasq systemd-exec (code=exited, status=2)
  Process: 24638 ExecStartPre=/usr/sbin/dnsmasq --test (code=exited, status=0/SUCCESS)

Содержание журнала:

-- Logs begin at Tue 2019-06-25 11:49:21 CEST, end at Sat 2019-06-29 12:48:50 CEST. --
Jun 25 11:49:29 EddLinux kernel: nouveau 0000:01:00.0: preinit failed with -22
Jun 25 11:49:29 EddLinux kernel: nouveau: DRM:00000000:00000080: init failed with -22
Jun 25 11:49:32 EddLinux avahi-daemon[297]: chroot.c: open() failed: No such file or directory
Jun 25 11:49:33 EddLinux systemd-rfkill[421]: Failed to open device: No such device
Jun 25 11:49:35 EddLinux dhclient[502]: Failed to get interface index: No such device
Jun 25 11:49:35 EddLinux dhclient[502]: 
Jun 25 11:49:35 EddLinux dhclient[502]: If you think you have received this message due to a bug rather
Jun 25 11:49:35 EddLinux dhclient[502]: than a configuration issue please read the section on submitting
Jun 25 11:49:35 EddLinux dhclient[502]: bugs on either our web page at www.isc.org or in the README file
Jun 25 11:49:35 EddLinux dhclient[502]: before submitting a bug.  These pages explain the proper
Jun 25 11:49:35 EddLinux dhclient[502]: process and the information we find helpful for debugging..
Jun 25 11:49:35 EddLinux dhclient[502]: 
Jun 25 11:49:35 EddLinux dhclient[502]: exiting.
Jun 25 11:49:35 EddLinux systemd[1]: Failed to start Raise network interfaces.
Jun 25 11:49:44 EddLinux wpa_supplicant[571]: nl80211: Unexpected encryption algorithm 5
Jun 25 12:17:49 EddLinux wpa_supplicant[571]: nl80211: Unexpected encryption algorithm 5
Jun 25 13:32:38 EddLinux wpa_supplicant[571]: nl80211: Unexpected encryption algorithm 5
Jun 25 13:32:43 EddLinux wpa_supplicant[571]: nl80211: Unexpected encryption algorithm 5
Jun 25 17:36:10 EddLinux wpa_supplicant[571]: nl80211: Unexpected encryption algorithm 5
Jun 25 18:29:26 EddLinux kernel: ACPI Error: No installed handler for fixed event - PowerButton (2), disabling (20160831/evevent-291)
Jun 25 18:46:36 EddLinux wpa_supplicant[571]: nl80211: Unexpected encryption algorithm 5
Jun 25 18:50:57 EddLinux kernel: ACPI Error: No installed handler for fixed event - PowerButton (2), disabling (20160831/evevent-291)
Jun 26 12:29:22 EddLinux wpa_supplicant[571]: nl80211: Unexpected encryption algorithm 5
Jun 26 13:08:52 EddLinux anacron[4522]: Can't find sendmail at /usr/sbin/sendmail, not mailing output
Jun 26 14:20:05 EddLinux wpa_supplicant[571]: nl80211: Unexpected encryption algorithm 5
Jun 26 14:31:18 EddLinux kernel: ACPI Error: No installed handler for fixed event - PowerButton (2), disabling (20160831/evevent-291)
Jun 26 15:38:34 EddLinux wpa_supplicant[571]: nl80211: Unexpected encryption algorithm 5
Jun 26 15:38:47 EddLinux kernel: sd 6:0:0:0: [sdb] No Caching mode page found
Jun 26 15:38:47 EddLinux kernel: sd 6:0:0:0: [sdb] Assuming drive cache: write through
Jun 26 15:42:56 EddLinux kernel: ACPI Error: No installed handler for fixed event - PowerButton (2), disabling (20160831/evevent-291)
Jun 26 15:52:46 EddLinux wpa_supplicant[571]: nl80211: Unexpected encryption algorithm 5
Jun 26 16:21:11 EddLinux kernel: ACPI Error: No installed handler for fixed event - PowerButton (2), disabling (20160831/evevent-291)
Jun 26 17:39:35 EddLinux wpa_supplicant[571]: nl80211: Unexpected encryption algorithm 5
Jun 26 18:16:05 EddLinux kernel: ACPI Error: No installed handler for fixed event - PowerButton (2), disabling (20160831/evevent-291)
Jun 26 18:25:44 EddLinux wpa_supplicant[571]: nl80211: Unexpected encryption algorithm 5
Jun 26 20:30:11 EddLinux kernel: ACPI Error: No installed handler for fixed event - PowerButton (2), disabling (20160831/evevent-291)
Jun 27 16:39:10 EddLinux wpa_supplicant[571]: nl80211: Unexpected encryption algorithm 5
Jun 27 17:06:50 EddLinux anacron[11980]: Can't find sendmail at /usr/sbin/sendmail, not mailing output
Jun 27 17:38:13 EddLinux kernel: ACPI Error: No installed handler for fixed event - PowerButton (2), disabling (20160831/evevent-291)
Jun 27 18:11:44 EddLinux wpa_supplicant[571]: nl80211: Unexpected encryption algorithm 5
Jun 27 18:12:28 EddLinux wpa_supplicant[571]: nl80211: Unexpected encryption algorithm 5
Jun 27 18:50:12 EddLinux kernel: ACPI Error: No installed handler for fixed event - PowerButton (2), disabling (20160831/evevent-291)
Jun 28 11:46:18 EddLinux wpa_supplicant[571]: nl80211: Unexpected encryption algorithm 5
Jun 28 11:48:33 EddLinux kernel: sd 6:0:0:0: [sdb] No Caching mode page found
Jun 28 11:48:33 EddLinux kernel: sd 6:0:0:0: [sdb] Assuming drive cache: write through
Jun 28 11:48:55 EddLinux kernel: FAT-fs (sdb1): unable to read boot sector to mark fs as dirty
Jun 28 11:53:31 EddLinux kernel: sd 6:0:0:0: [sdb] No Caching mode page found
Jun 28 11:53:31 EddLinux kernel: sd 6:0:0:0: [sdb] Assuming drive cache: write through
Jun 28 11:53:41 EddLinux wpa_supplicant[571]: nl80211: Unexpected encryption algorithm 5
Jun 28 12:08:31 EddLinux anacron[17533]: Can't find sendmail at /usr/sbin/sendmail, not mailing output
Jun 28 12:52:24 EddLinux kernel: ACPI Error: No installed handler for fixed event - PowerButton (2), disabling (20160831/evevent-291)
Jun 29 12:13:35 EddLinux anacron[21404]: Can't find sendmail at /usr/sbin/sendmail, not mailing output
Jun 29 12:35:05 EddLinux dnsmasq[24574]: failed to create listening socket for port 53: Address already in use
Jun 29 12:35:05 EddLinux dnsmasq[24574]: FAILED to start up
Jun 29 12:35:05 EddLinux systemd[1]: Failed to start dnsmasq - A lightweight DHCP and caching DNS server.
Jun 29 12:37:37 EddLinux dnsmasq[24641]: failed to create listening socket for port 53: Address already in use
Jun 29 12:37:37 EddLinux dnsmasq[24641]: FAILED to start up
Jun 29 12:37:37 EddLinux systemd[1]: Failed to start dnsmasq - A lightweight DHCP and caching DNS server.

Я уже переустановил. Любая помощь приветствуется!

решение1

Проблема

не удалось создать прослушивающий сокет для порта 53: адрес уже используется

Вот и все.

DNS использует запросы, которые отправляют данные на порт 53 (чаще всего UDP, но также может использоваться TCP).

dnsmasqявляется (помимо прочего) так называемым переадресующим DNSсервер,и тот факт, что это сервер, означает, что он хочетслушатьпо крайней мере на 53/UDP и также, возможно, на 53/TCP.

Только один процесс (запущенная программа) может прослушивать порт с определенным номером на определенном IP-адресе. Таким образом, ошибка означает, что какая-то другая программа уже прослушивает порт 53, но dnsmasqне может этого сделать и завершает работу.

Что с этим делать

Сначала выясните, что прослушивает 53/UDP.

  1. Установить iproute2:

    # apt install iproute2
    
  2. Посмотрите, кто использует 53/UDP:

    # ss -nlup
    

    Варианты означают:

    • Показыватьнцифровые адреса, не пытайтесь преобразовать их с помощью DNS.
    • Покажи тольколпрослушивание розеток.
    • Покажи толькотысокеты dp (на самом деле, конечные точки, но неважно).
    • Показыватьппроцессы, которые открыли эти сокеты.

    (Обратите внимание, что вам придется запустить эту программу как root—возможно, через sudo; это зависит от того, как вы настроили способ повышения привилегий в вашей системе.)

    Теперь найдите в выходных данных запись, содержащую что-то вроде [::]:53— точное прочтение может отличаться, скажем, 0.0.0.0:53, но вы наверняка увидите этот :53суффикс — это номер порта, — а затем посмотрите на столбец «пользователи» — в нем должно быть указано имя программы, открывшей этот сокет.

    Скажем, в моей системе соответствующий like выглядит так UNCONN 0 0 [::]:53 [::]:* users:(("dnsmasq",pid=601,fd=6))(я немного сократил пробелы для краткости). Обратите внимание, что пользователь — dnsmasq; в вашей системе это будет по-другому.

Хорошо, как только вы выяснили, кто виноват, попробуйте подумать, как удалить эту программу. После этого, simple # systemctl restart dnsmasqдолжен взяться за дело.

Связанный контент