In this article, we will show you how to configure Active Directory on Windows Server 2012, 2016, 2019 or 2022. Active Directory allows us to centrally manage users, servers, printers, … there is no need to discuss the advantages of having everything centralized; if we have several interconnected servers, any change becomes much easier with Active Directory, hereafter AD. In this article, we will explain how to configure AD. You can consult these other articles: how to replicate AD on a secondary server and add a server to AD. For these 3 articles, we will use servers with these IPs:
- KB-AD-01 => 172.16.0.1
- KB-AD-02 => 172.16.0.2
- KB-SRV-01 => 172.16.0.11
- KB-SRV-02 => 172.16.0.12
Prepare the network configuration
The first thing we will do is configure our server's network adapters. Basically, we will configure the DNS servers to use those configured by AD internally. We will also configure DNS records to be created only with the servers' internal IPs, thus avoiding problems with the firewalls in the customer panel. Keep in mind that the same record can be created with both the public and private IP, and when you access it through the DNS record, it may sometimes use the public IP and sometimes the private one -depending on the firewall configuration, this may fail-.
- Public IP network adapter:
- Disable TCP/IPv6.
- Configure DNS servers 172.16.0.1 and 172.16.0.2.
- Opciones avanzadas > DNS, disable the option to create a DNS record.
- Opciones avanzadas > WINS, disable NetBIOS over TCP/IP.
- Private network adapter:
- Disable TCP/IPv6.
- Set the IP to 172.16.0.1 and the subnet mask to 255.255.255.0.
- Configure DNS servers 172.16.0.1 and 172.16.0.2.
Here are some screenshots of the entire process:
Add roles
Now that the network adapters are configured, we can proceed to install AD. In our case, we will add a DNS server, but this is optional. To add AD, we will go to the administrador del servidor and add roles, follow the wizard, and under Server Roles select the checkboxes for Active Directory Domain Services and DNS Server and follow all the steps until the AD installation finishes -do not close the installer-. Here are screenshots of the process:
Configure Active Directory
When the AD installation finishes, we will have a link to configure AD. To do this, click Promote this server to a domain controler. The AD wizard will open, and for the configuration type we will choose Add a new forest, and enter the domain we want to use. In the next step, we will enter our password to recover AD in the event of a failure and follow the wizard with the default options. Here are screenshots of the process:
Configure DNS forwarders
When domain promotion finishes, the server will restart automatically. We must now log in with the user “kb-test\administrator” and the same password we already had. Finally, we will configure “DNS Forwarders”, which allows us to correctly resolve DNS records outside our domain. To do this, we will open the DNS manager, right-click the server name and choose Propiedades. In the window that opens, we will click the Forwarders tab. We will delete the server “172.16.0.2”, add the DNS servers we want to use and accept the changes. Here are screenshots of the process: