---
slug: "ubuntu-samba-ad-dc-dns"
title: "When Starting AD Domain Controller (samba-ad-dc) on Ubuntu 18 with Samba 4.7, It Fails Due to DNS Errors"
description: "When you start samba-ad-dc using the command `$ sudo systemctl start samba-ad-dc`, and check either /var/log/samba/log.smbd or /var/log/samba/%m, it appears that port 53 is unavailable."
url: "https://www.ytyng.com/en/blog/ubuntu-samba-ad-dc-dns"
publish_date: "2018-09-04T01:53:11Z"
created: "2018-09-04T01:53:11Z"
updated: "2026-02-27T09:46:42.979Z"
categories: []
keywords: ""
featured_image_url: "https://media.ytyng.com/resize/20230812/9a5678166ae34db1b3c34b715eb83829.png.webp?width=768"
has_video: false
has_music: false
video_urls: []
music_urls: []
lang: "en"
---

# When Starting AD Domain Controller (samba-ad-dc) on Ubuntu 18 with Samba 4.7, It Fails Due to DNS Errors

```bash
$ sudo systemctl start samba-ad-dc
```
<p>When starting samba-ad-dc, you might see the following in <code>/var/log/samba/log.smbd</code> or <code>/var/log/samba/%m</code>:</p>
<pre style="background-color: #ffffff; color: #000000; font-family: 'Menlo'; font-size: 9.0pt;">
<span style="color: #c604b7; font-weight: bold;">[2018/09/04 10:15:54.282382,  0]</span> ../source4/smbd/server.c:620(binary_smbd_main)
  samba: using 'standard' process model
samba: setproctitle not initialized, please either call setproctitle_init() or link against libbsd-ctor.
samba: setproctitle not initialized, please either call setproctitle_init() or link against libbsd-ctor.
samba: setproctitle not initialized, please either call setproctitle_init() or link against libbsd-ctor.
samba: setproctitle not initialized, please either call setproctitle_init() or link against libbsd-ctor.
samba: setproctitle not initialized, please either call setproctitle_init() or link against libbsd-ctor.
samba: setproctitle not initialized, please either call setproctitle_init() or link against libbsd-ctor.
samba: setproctitle not initialized, please either call setproctitle_init() or link against libbsd-ctor.
samba: setproctitle not initialized, please either call setproctitle_init() or link against libbsd-ctor.
samba: setproctitle not initialized, please either call setproctitle_init() or link against libbsd-ctor.
samba: setproctitle not initialized, please either call setproctitle_init() or link against libbsd-ctor.
samba: setproctitle not initialized, please either call setproctitle_init() or link against libbsd-ctor.
samba: setproctitle not initialized, please either call setproctitle_init() or link against libbsd-ctor.
<span style="color: #c604b7; font-weight: bold;">[2018/09/04 10:15:54.331785,  0]</span> ../source4/smbd/service_stream.c:360(stream_setup_socket)
samba: setproctitle not initialized, please either call setproctitle_init() or link against libbsd-ctor.
  Failed to listen on 0.0.0.0:53 - NT_STATUS_ADDRESS_ALREADY_ASSOCIATED
<span style="color: #c604b7; font-weight: bold;">[2018/09/04 10:15:54.336989,  0]</span> ../source4/dns_server/dns_server.c:648(dns_add_socket)
  Failed to bind to 0.0.0.0:53 TCP - NT_STATUS_ADDRESS_ALREADY_ASSOCIATED
</pre>
<p>It appears that port 53 couldn't be used.</p>
```bash
$ sudo lsof -i:53
```
<p>When you run this command, you might see:</p>
<pre style="background-color: #ffffff; color: #000000; font-family: 'Menlo'; font-size: 9.0pt;">
COMMAND   PID            USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
systemd-r 483 systemd-resolve   12u  IPv4  16576      0t0  UDP 127.0.0.53:domain
systemd-r 483 systemd-resolve   13u  IPv4  16577      0t0  TCP 127.0.0.53:domain (LISTEN)
</pre>
<p>The process <code>systemd-resolve</code> is using port 53.</p>
<p>Therefore, you need to stop it:</p>
```bash
sudo systemctl stop systemd-resolved
sudo systemctl disable systemd-resolved
```
```bash
$ sudo systemctl stop samba-ad-dc
$ sudo systemctl start samba-ad-dc
```
```bash
$ sudo lsof -i:53
COMMAND  PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
samba   2674 root   36u  IPv6  39433      0t0  TCP *:domain (LISTEN)
samba   2674 root   38u  IPv6  39434      0t0  UDP *:domain
samba   2674 root   39u  IPv4  39435      0t0  TCP *:domain (LISTEN)
samba   2674 root   40u  IPv4  39436      0t0  UDP *:domain
```
<p>Now port 53 is available.</p>
<p>References:</p>
<p>https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1690099</p>
<p>https://askubuntu.com/questions/898605/how-to-disable-systemd-resolved-and-resolve-dns-with-dnsmasq</p>
