Create an Active Directory Infrastructure with Samba4 on Ubuntu – Part 1

If You Appreciate What We Do Here On TecMint, You Should Consider:

  1. Stay Connected to: Twitter | Facebook | Google Plus
  2. Subscribe to our email updates: Sign Up Now
  3. Get your own self-hosted blog with a Free Domain at ($3.45/month).
  4. Become a Supporter - Make a contribution via PayPal
  5. Support us by purchasing our premium books in PDF format.
  6. Support us by taking our online Linux courses

We are thankful for your never ending support.

Matei Cezar

I'am a computer addicted guy, a fan of open source and linux based system software, have about 4 years experience with Linux distributions desktop, servers and bash scripting.

Your name can also be listed here. Got a tip? Submit it here to become an TecMint author.

RedHat RHCE and RHCSA Certification Book
Linux Foundation LFCS and LFCE Certification Preparation Guide

You may also like...

88 Responses

  1. Tony Mcmahon says:

    Has anyone done this on Ubuntu 18.04? Are any of the steps different?

  2. Thank you for the perfect tutorial! I had the same problems with DNS where I could not ping the server. I found out after a second installation attempt, that I should follow the steps exactly as mentioned here and at the Ubuntu server installation instructions and after that everything worked fine.

    On my first attempt I installed the Linux server without looking the installation instructions and I installed the system as per usual. So I pre-installed DNS and other features, encrypted my home folder, and did not interrupt the network detection process to enter the settings manually.

    I also skipped step 3 from this page. On the second attempt I just entered the same hostname as on the installation process. I think this, or the pre-installed DNS server caused the problem.

    I also found two typos:
    At step 11 sudo mv /etc/krb6.conf /etc/krb5.conf.initial should be sudo mv /etc/krb5.conf /etc/krb5.conf.initial and at step 11, it should be broadcast.

  3. HJ Z says:

    Great tutorial,

    I did this on a Debian 9.6. Most things worked fine.

    I had to systemctl unmask samba-ad-dc, and install net-tools.

    I checked with smbclient -L localhost %U – It puzzles me why does Workgroup always return WORKGROUP?

  4. Juston Griggs says:


    Great Document, however, everything works for up to Step 16, when I do the command:

    # ping –c3 goneoweb.local

    I get the error

    ping: unknown host –c3

    Here is my /etc/network/interfaces and my /etc/resolv.conf.

    iface eth0 inet static
            dns-search              goneoweb.local
    search goneoweb.local

    I’m kind of at a standstill. I’m in the process of setting this up for use with my small business, 3 computers, and 6 users. So any help would be greatly appreciated! Again, great article! Thanks

    • Cezar Matei says:

      Add 127…. to resolv.conf file. why you use the second nameserver. Is that a dc also? If not, leave only 127…8n both files.

      • Juston O Griggs says:

        The machine Im setting all this up on has a static of, so I dont need to reference that in the resolv.conf?

  5. Michael Weber says:

    It’s a very nice to read guide, thank you for that. Still i have one issue i can not figure out:

    The DNS.

    I can ping rowdyserver
    I can ping rowdyserver.lindelaan.lan

    but i dont get any anwer when i just ping lindelaan.lan

    my resolv.conf looks like this

    search feuer.lan

    and i have no idea where to look to fix that.

  6. Venkatesh says:

    Thanks for this interesting tutorial. I have configured samba server in my system. But after the setup, the internet is not working. I getting the below-mentioned error. Please guide me to resolve the issues.

    FYI The error which gets is “Failed to start Raise network interfaces.” when restarting networking service

  7. Mohan N says:

    I am a newbie on Ubuntu as AD Server. I was going through the steps on this article on osx-virtualbox-ubuntu16 (host-only + nat). The same VM also has DNS (bind9), will be adding DHCP here as well if all goes well. :)

    For the DNS to be able to work for “host -t A tecmint.lan” what kind of record should be there in the DNS?

Got something to say? Join the discussion.

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.