#002 Build Your Own Domain Controller
You may be thinking, "Why do I need to know how to build a DC, I'm a DBA?"
Fortunately, DBAs don't typically build DCs. However, I've found that knowing a bit about how SQL Server utilizes Active Directory has been very beneficial.
For instance, I was building a Windows Server Failover Cluster for an employer once. Doing this as a regular user, not a domain admin, I encountered several errors due to permissions.
The systems administrators were not familiar with cluster builds and couldn't help. Access to a DC in my test environment allowed me to work through the permission errors and relay those steps to the systems administrators.
Plus, I can count the number of SQL Servers I've worked with on one hand that weren't joined to a domain in 18 years.
This week's challenge is to install and configure Active Directory Domain Services.
Ready?
Estimated time to complete: Less than 4 hours.
Step 1: Preparing your virtual machine
In last week's challenge, you built two virtual machines; DC1 and SRV1. DC1 will be our focus today.
Before making changes to DC1, create a snapshot (one of the benefits of using a virtual machine). A snapshot is a copy of the state of a virtual machine at a specific time.
The instructions depend on which hypervisor you have chosen. Instructions for VMware Workstation and Oracle VirtualBox are below.
VMware Workstation Pro Snapshot
If you're using Vagrant, use the vagrant snapshot save command. In module 6 of the Automated Sandbox Fundamentals course, I cover Hashicorp Vagrant in detail.
The snapshot will be your starting point. If things go awry, revert the VM and start again.
Step 2: Install Active Directory Domain Services
Before installing ADDS, we'll need to make sure DC1 has a static IP address. You don't want the domain controller or DNS server changing IPs once the DHCP lease expires.
Bad things will happen (your client VMs won't be able to connect to the domain or resolve hostnames).
- Select an IP address that resides outside the DHCP IP range. Below is an example of my DHCP settings (vmnet8). Since my DHCP IP range starts at 192.168.88.128 and ends at 192.168.88.254, I've used 192.168.88.3 for the DC1 IP address. Be sure to keep track of the IP you assigned. You'll need it later when configuring your client machines.
- Install ADDS. Check out the link below for steps on how to install using Server Manager or PowerShell.
Step 3: Configure your domain
Next, you'll need to promote DC1 to a Domain Controller. This is the first domain controller, so you'll need to create a new forest.
Choose a name for your domain during this process (be creative, not like me. I just used HOMELAB.LOCAL).
Active Directory Forest Set Up
Step 4: Configure DNS
After promoting DC1 to the domain controller, you'll need to configure DNS forwarders. Forwarders are external DNS servers like your ISPs or a common public resolver.
This is where hostnames will be resolved if they reside outside of your sandbox (www.automatesql.com for example).
I use 8.8.8.8 (Google Public DNS) but you can use whatever you like as long as it resolves hostnames.
Resources
If you get stuck, check out the video below. I set up ADDS during the first 10 minutes. Be sure to hit that subscribe button while you're there (if, and only if, it was helpful).
|
Helping Others and Sharing Your Results
That's it for this week.
If you have tips other readers can learn from, please share them in the comments. You can message me on LinkedIn or post about it and tag me with the #dbachallenges hashtag.
Feedback
If there's a DBA Challenge you'd like to see, please let me know by replying to this email. Have ideas on how to make these more useful? I'd love to hear those too.
Good luck and I'm looking forward to seeing your results!
Luke
Responses