DHCP e Domain Controller sullo stesso host

Molto spesso il ruolo DHCP viene installato su un host che assolve anche al ruolo di Domain Controller occorre però precisare che questa scelta presenta delle implicazioni di sicurezza evidenziate dal tool Best Practices Analyzer presente in Windows Server a partire dalla versione 2008 R2.

In particolare occorre configurare le credenziali per eseguire il secure dynamic DNS update e tali credenziali devono essere membri dei gruppi locali Administrators o DHCP Administrators. A rigardo si veda la BPA DHCP: Credentials for DNS update should be configured if secure dynamic DNS update is enabled and the domain controller is on the same host as the DHCP server.

Come riportato nel post DHCP Server in DCs and DNS Registrations se non si esegue tale configurazione si va incontro a rischi per la sicurezza del Domain Controller e ad un funzionamento ridotto:

What happens when the DHCP Server service is installed in a DC and no alternate credentials are configured?
A common error is to think that the DHCP Server service running in a DC will use its service account security context to register records in DNS if no alternate credentials are configured, and then there is security risk. In fact, this is not the behavior of the DHCP Server in a DC.
If the DHCP Server service detects that it is running in a domain controller, and no alternate credentials for DNS registrations have been configured, then it decides to not do any registrations for DHCP clients and logs event DHCP/1056.

NOTE: this does not affect other registrations being done by the computer where the DHCP Server service is running, it only affects the registration of DNS records by the DHCP Server on behalf of the DHCP clients.

What is the side-effect of this?

When the DHCP Server decides that it is not going to do registrations for DHCP clients, it stops setting option 81 in the responses to clients (option 81 is used to negotiate who registers what between the DHCP Server and the DHCP Client). If the client does not get this option in the response from the server then it goes and does its own registrations.

Recommendations

If the DHCP Server is configured to run in a DC, make sure that the alternate credentials for DNS registrations are correctly configured.

Use a “normal” user account, not an administrative or privileged account, for the alternate credentials. Just make sure to use the Password Never Expires option. There is not need to add this account to any special group. The steps to configure these credentials are documented in http://support.microsoft.com/kb/282001.
If there are more than one DHCP Server in the environment, try to use the same account for the alternate credentials in all of them.

In ogni caso vale sempre la vecchia regola che se è possibile è consigliabile installare ruolo Domain Controller su un server o una virtual machine dedicata come indicato in Securing Active Directory Administrative Groups and Accounts

“On a server that is dedicated to the domain controller role, you can reduce the number of members in the Backup Operators group. If possible, domain controllers should be dedicated, but in smaller organizations a domain controller might be used to run other applications. In this case, users who are responsible for backing up applications on the domain controller must also be trusted as service administrators because they have the privileges that enable them to restore files, including the system files, on domain controllers.”

In ogni caso vi sono ruoli e funzionalità che non dovrebbero o non possono essere installati su un Domain Controller come ad esempio la feature IPAM (IP Address Management) come indicato al seguente IPAM Deployment Planning:

“IPAM must be installed on a domain member computer. You cannot install IPAM on a domain controller. If IPAM is installed on the same server with DHCP, then DHCP server discovery will be disabled.”

Conclusioni

Sebbene il DHCP previa la configurazione di sicurezza descritta possa essere installato su un Domain Controller è preferibile per motivi di sicurezza  e di semplificazione della gestione dell’infrastruttura dedicare un host fisico o virtuale al DHCP. Il server DHCP in effetti essendo essenziale ai fini delle funzionalità di rete soprattutto in infrastrutture con un elevato numero di client dovrebbe essere istallato su un server con questo unico ruolo i modalità core in modo da ridurre il numero di riavvi a causa dell’installazione degli aggiornamenti del sistema operativo. In Windows Server 2012 per garantire il servizio DHCP in alta affidabilità è possibile implementare il DHCP Failover, a riguardo si vedano i seguenti link:

Update 01

In Windows Server 2003 invece era sconsigliabile implementare il DHCP su un DC che aveva anche il ruolo DNS con il dynamic update attivato a causa di un memory leak descritto nella KB 939928: A memory leak occurs if the DNS dynamic update protocol is enabled on a DHCP server that is running Windows Server 2003.