Question: how to configure linux samba server as a primary domain controller?
Answer: Setup Proper Host Name. Make sure you've setup the appropriate hostname and static ip. ... 
Install Samba from Source. On CentOS, by default samba packages will not be installed for minimal installation type. ... 
Setup Domain Provision. ... 
Start Samba Service. ... 
Check Samba Version. ... 
Verify Domains. ... 
Configure Kerberos.