Custom Domain Names
Earn 25 points (50 with Pro) in two steps
- ① Read through the lesson — each section gets a ✓ as you scroll through it.
- ② When every section has a ✓, tap Complete lesson.
0 of 11 read · keep scrolling
✦ See fewer ads and earn double points — 50 a lesson instead of 25 — with Pro
Mastering Custom Domain Names in Microsoft Entra ID
Introduction: Why Custom Domains Matter
When you first create a Microsoft Entra ID (formerly Azure Active Directory) tenant, the platform assigns you a default domain name. This usually looks something like yourcompany.onmicrosoft.com. While this serves as a functional starting point, it is rarely sufficient for a professional production environment. Using an onmicrosoft.com address for your users’ primary identities—such as email addresses or login credentials—looks unprofessional to clients, partners, and employees. Furthermore, it creates a lack of brand consistency across your digital infrastructure.
Implementing a custom domain name, such as contoso.com, is one of the most critical foundational steps in identity management. It allows your organization to align its identity solution with its existing internet presence. Beyond aesthetics, custom domains simplify the user experience by allowing employees to sign in with an email address they already use. It also provides the necessary foundation for advanced identity features like federated authentication and seamless integration with other Microsoft 365 services. In this lesson, we will explore the technical requirements, the verification process, and the strategic best practices for managing custom domains within Microsoft Entra ID.
Not read yet
Understanding the Relationship Between Domains and Identity
In the context of Entra ID, a domain is more than just a URL; it is a namespace for your user objects. Every user account created in your tenant must be associated with a verified domain. When you add a custom domain, you are effectively telling Microsoft that your organization owns that specific DNS namespace and has the authority to issue identities under it.
The Default Domain vs. Custom Domains
The initial onmicrosoft.com domain is permanent and cannot be deleted. It acts as the fallback domain for the tenant. If a user is created without a specific domain assignment, or if a custom domain is removed, the system defaults to this initial address. Understanding this distinction is vital because it prevents you from accidentally locking out users or breaking authentication flows during migration projects.
Callout: The "onmicrosoft.com" Reality Even after you add and verify a custom domain, the
onmicrosoft.comdomain remains in your tenant. You should treat it as a technical necessity rather than a public-facing address. Always ensure that your primary administrative accounts and user UPNs (User Principal Names) are transitioned to your custom domain to maintain a consistent brand identity.
Not read yet
Prerequisites for Adding a Custom Domain
Before you begin the configuration process, you must ensure you have the necessary access and ownership of the domain you intend to add. Microsoft Entra ID requires you to prove that you own the domain by modifying its DNS records.
Technical Requirements Checklist:
- Administrative Access: You must have the Global Administrator or Custom Domain Name Administrator role within the Entra ID tenant.
- DNS Control: You must have access to your domain registrar’s management portal (e.g., GoDaddy, Cloudflare, Namecheap, or your internal DNS server).
- Public Visibility: The domain must be publicly reachable via DNS records for the verification process to succeed.
- No Conflicts: Ensure the domain is not already verified in another Microsoft 365 or Azure tenant. If it is, you must remove it from the previous tenant before adding it to the new one.
Step-by-Step: Adding and Verifying a Custom Domain
The process of adding a domain is relatively straightforward, but it requires precision to ensure the DNS records are propagated correctly. Follow these steps to integrate your domain with Entra ID.
Step 1: Initiating the Process
- Log in to the Microsoft Entra admin center.
- Navigate to Identity > Settings > Domain names.
- Click on + Add custom domain.
- Enter the domain name you wish to add (e.g.,
example.com). - Click Add domain.
Step 2: Verification via DNS Records
After clicking "Add domain," Entra ID will provide you with specific DNS record values. You must add these to your domain registrar's configuration to prove ownership.
- TXT Record Method: This is the most common approach. You create a TXT record with the host value
@(or blank) and the provided value (e.g.,MS=ms12345678). - MX Record Method: Alternatively, you can use an MX record, though this is less common and generally reserved for specific scenarios where you want to route mail traffic immediately.
Step 3: Verification Execution
Once the record is added at your registrar, return to the Entra ID portal and click Verify. Note that DNS propagation can take anywhere from a few minutes to several hours, depending on your registrar’s Time-to-Live (TTL) settings. If the verification fails, wait a few minutes and try again.
Tip: DNS Propagation Delays If you are using a registrar with slow update times, use an online tool like
digornslookupto verify that your TXT record is visible globally before clicking the "Verify" button in the Entra portal. This saves time and prevents frustration.
Not read yet
Configuring Primary Domains and UPNs
Once the domain is verified, it becomes available for use. However, simply adding the domain does not automatically update your users. You must decide how the domain will be utilized.
Setting the Primary Domain
The primary domain is the default domain assigned to new users when they are created. To change this:
- Navigate to Domain names in the Entra admin center.
- Select your newly verified domain.
- Click Make primary.
Updating User Principal Names (UPNs)
The UPN is the identifier users use to sign in. Many organizations migrate from [email protected] to [email protected] after the domain is verified. While you can change this manually for individual users, you should use PowerShell or the Microsoft Graph API for bulk updates.
Example: Updating a UPN via PowerShell
# Connect to Microsoft Graph
Connect-MgGraph -Scopes "User.ReadWrite.All"
# Update a single user's UPN
Update-MgUser -UserId "[email protected]" -UserPrincipalName "[email protected]"
Warning: The Impact of UPN Changes Changing a user's UPN is a significant event. It can disrupt access to legacy applications, local file shares, and cached credentials on devices. Always communicate the change to your users and ensure they are aware that their sign-in address has changed.
Not read yet
Advanced Domain Configurations
Beyond simple verification, there are several advanced configurations that organizations often require. Understanding these will help you scale your identity solution as your company grows.
Subdomains
Entra ID allows you to add subdomains (e.g., us.contoso.com or dev.contoso.com). You can verify subdomains independently of the root domain. This is useful for decentralized organizations where different business units manage their own identity infrastructure but remain under the same corporate umbrella.
Federated Domains
If you use an on-premises identity provider like Active Directory Federation Services (AD FS), you can configure your custom domain as a "Federated" domain. This redirects authentication requests away from Microsoft’s cloud servers and back to your local environment.
| Domain Type | Authentication Location | Best Use Case |
|---|---|---|
| Managed | Microsoft Entra ID | Cloud-only organizations, standard setups. |
| Federated | On-premises (e.g., AD FS) | Hybrid environments with legacy auth requirements. |
Not read yet
Best Practices for Domain Management
Managing domains effectively requires a balance between security and usability. Follow these industry-standard practices to maintain a healthy environment.
- Use a Dedicated Administrative Account: Always perform domain configuration tasks using a Global Administrator account that is not tied to a single person. Use an account with a secure, long password and Multi-Factor Authentication (MFA).
- Clean up Unused Domains: Over time, companies acquire other companies or change their branding. If you have domains that are no longer in use, remove them from your tenant to reduce the attack surface and keep your configuration clean.
- Monitor DNS Health: Your domain's health depends on the records you maintain. Ensure that your DNS records (SPF, DKIM, and DMARC) are correctly configured to prevent email spoofing, which is a common security risk associated with custom domains.
- Automate UPN Updates: If you are a large organization, do not manually change UPNs. Build a script that iterates through your user list and performs the update in a controlled, staged rollout.
- Plan for Hybrid Sync: If you are using Microsoft Entra Connect to sync users from on-premises Active Directory, ensure that the UPNs in your local AD match the verified domains in Entra ID before the sync occurs. Mismatched UPNs can lead to the creation of duplicate accounts or synchronization errors.
Not read yet
Common Pitfalls and Troubleshooting
Even experienced administrators run into issues when configuring domains. Being aware of these traps can save you significant downtime.
The "Domain Already Verified" Error
This occurs if the domain is still associated with a different tenant—perhaps a legacy trial subscription or a forgotten dev environment. To fix this, you must log into the old tenant and remove the domain. If you no longer have access to that tenant, you must contact Microsoft Support to prove ownership and have them force-remove the domain.
Synchronization Errors in Hybrid Environments
When you sync local users, Entra ID expects the UPN suffix to be a verified domain. If you sync a user with a suffix like [email protected] and that domain is not verified in Entra ID, the sync will fail or default to the onmicrosoft.com suffix.
- The Fix: Always add and verify your internal domains (even if they aren't public-facing) in Entra ID, or use a UPN transformation rule in your sync configuration to map internal addresses to your public verified domain.
Email Delivery Issues
Adding a custom domain to Entra ID does not automatically route your email. You must still configure your MX records at your DNS registrar to point to the correct mail server (e.g., Exchange Online or an external mail provider). Failing to do this will result in users being able to sign in but unable to receive email.
Callout: The SPF/DKIM/DMARC Triad When you set up a custom domain for identity, you are also implicitly setting it up for communication. Always implement SPF (Sender Policy Framework), DKIM (DomainKeys Identified Mail), and DMARC (Domain-based Message Authentication, Reporting, and Conformance). These records protect your domain from being used for phishing, which protects your users and your reputation.
Not read yet
Managing Domains via PowerShell
While the portal is intuitive for a single domain, PowerShell is the preferred tool for managing multiple domains or automating the verification process. The Microsoft Graph PowerShell SDK is the modern standard for these tasks.
Listing Verified Domains
To see which domains are currently active in your tenant, use the following command:
Get-MgDomain | Select-Object Id, IsVerified, IsDefault
Adding a Domain via PowerShell
If you need to add a domain programmatically, you can use the New-MgDomain cmdlet.
New-MgDomain -Id "newcompany.com"
After running this, you would then retrieve the DNS verification records using Get-MgDomainVerificationDnsRecord and proceed with the verification steps.
Designing for Future Growth
When you initially configure your custom domain, think about the long-term architecture of your identity. If your organization is planning to acquire other companies, consider how those domains will be integrated. Will you create a separate tenant, or will you bring them into your existing tenant?
Multi-Tenant vs. Single-Tenant Considerations
- Single-Tenant: Easier to manage, unified global address book, consistent security policies. Best for most organizations.
- Multi-Tenant: Necessary for strict regulatory separation, distinct business units, or when organizations need to keep their infrastructure completely isolated.
If you choose a single-tenant approach, you can add multiple verified domains to the same tenant. This is a common pattern for conglomerates. Each user can be assigned a UPN that reflects their specific brand or business unit while still being managed by the same centralized Entra ID policies.
Not read yet
Security Implications of Custom Domains
Your domain name is the public face of your identity perimeter. If an attacker gains control of your domain's DNS, they can potentially intercept verification emails, reset passwords for services that rely on email-based verification, and perform man-in-the-middle attacks.
Securing the Registrar
The security of your domain starts at the registrar. Ensure that your registrar account is protected by:
- Multi-Factor Authentication: Require MFA for anyone logging into the registrar portal.
- Domain Locking: Enable domain locking to prevent unauthorized transfers of your domain to another provider.
- Role-Based Access Control: If your registrar supports it, limit access to DNS settings to only the necessary personnel.
Monitoring for Domain Squatting
Attackers often register domains that look similar to yours (e.g., contoso-support.com) to conduct phishing campaigns. While you cannot stop others from registering these domains, you can use threat intelligence tools to monitor for newly registered domains that mimic your brand. This allows you to proactively block these domains in your email filters and security gateways.
Not read yet
Step-by-Step: Troubleshooting a Failed Verification
If you find yourself in a situation where a domain refuses to verify, follow this systematic approach:
- Check the TTL (Time-to-Live): If you recently updated your DNS, wait for the TTL period to expire. If your TTL is 3600 seconds (one hour), you may need to wait at least that long for the change to propagate.
- Validate the TXT Record Syntax: Ensure there are no typos in the TXT value. The value must exactly match what the Entra portal provided.
- Verify the Hostname: Ensure the host field is set correctly. Some registrars require
@to represent the root domain, while others require the field to be left blank. - Check for Duplicate Records: Ensure there are no conflicting TXT records that might be confusing the DNS resolver.
- Use External DNS Lookups: Use a public tool like
Google Admin Toolbox Digto confirm that the record is visible from outside your internal network.
Not read yet
Summary of Key Takeaways
Implementing a custom domain is a foundational skill for any identity administrator. It bridges the gap between a technical platform and a professional, usable identity system. As you move forward, keep these key points in mind:
- Identity Foundation: The
onmicrosoft.comdomain is a technical necessity, but your custom domain is the standard for your users’ identity and brand presence. - DNS is Critical: The verification process relies entirely on your ability to manage DNS records. Familiarity with your registrar’s interface is mandatory.
- UPN Consistency: Your UPNs should match your verified domains. Use automated tools to update UPNs to ensure consistency across your environment.
- Security is Paramount: Protect your domain registrar account with the same level of security as your Entra ID tenant. A compromised domain is a compromised identity.
- Plan for Hybrid Sync: If you have an on-premises Active Directory, ensure that your UPN suffixes match the verified domains in Entra ID to avoid synchronization failures.
- Continuous Monitoring: Keep your DNS records clean and up-to-date, and implement SPF, DKIM, and DMARC to protect your domain from impersonation.
- Scalability: Design your domain strategy with future growth in mind, considering how subdomains or multiple domains might be integrated as your organization expands.
By following these guidelines, you will establish a reliable, secure, and professional identity environment that supports your organization's needs both today and in the future. Remember that identity management is an iterative process; as your organization changes, your domain configuration should be reviewed and updated to reflect your evolving requirements.
Not read yet
Each section gets a ✓ as you scroll through it. Tap the button to jump to the next one.
- Introduction to Microsoft Entra ID
- Introduction to Microsoft Entra ID Quiz5q
- Configure Tenant Settings
- Configure Tenant Settings Quiz5q
- Custom Domain Names
- Custom Domain Names Quiz5q
- Device Identity and Registration
- Device Identity and Registration Quiz5q
- Company Branding Configuration
- Company Branding Configuration Quiz5q
- Create and Manage User Accounts
- Create and Manage User Accounts Quiz5q
- Bulk User Operations
- Bulk User Operations Quiz5q
- Create and Manage Groups
- Create and Manage Groups Quiz5q
- Dynamic Group Membership
- Dynamic Group Membership Quiz5q
- Administrative Units
- Administrative Units Quiz5q
- License Assignment and Management
- License Assignment and Management Quiz5q
- External Collaboration Settings
- External Collaboration Settings Quiz5q
- Invite External Users
- Invite External Users Quiz5q
- B2B Collaboration and Direct Connect
- B2B Collaboration and Direct Connect Quiz5q
- Cross-Tenant Access Settings
- Cross-Tenant Access Settings Quiz5q
- Identity Provider Configuration
- Identity Provider Configuration Quiz5q
- Microsoft Entra Connect Overview
- Microsoft Entra Connect Overview Quiz5q
- Password Hash Synchronization
- Password Hash Synchronization Quiz5q
- Pass-Through Authentication
- Pass-Through Authentication Quiz5q
- Federation with AD FS
- Federation with AD FS Quiz5q
- Entra Connect Cloud Sync
- Entra Connect Cloud Sync Quiz5q
- Authentication Methods Overview
- Authentication Methods Overview Quiz5q
- Passwordless Authentication
- Passwordless Authentication Quiz5q
- Self-Service Password Reset
- Self-Service Password Reset Quiz5q
- Password Protection and Smart Lockout
- Password Protection and Smart Lockout Quiz5q
- FIDO2 Security Keys
- FIDO2 Security Keys Quiz5q
- Microsoft Authenticator App
- Microsoft Authenticator App Quiz5q
- Conditional Access Overview
- Conditional Access Overview Quiz5q
- Create Conditional Access Policies
- Create Conditional Access Policies Quiz5q
- Named Locations and Terms of Use
- Named Locations and Terms of Use Quiz5q
- Session Controls and App Controls
- Session Controls and App Controls Quiz5q
- Authentication Strength Policies
- Authentication Strength Policies Quiz5q
Spend your points to unlock exam-style practice questions
Spend points to unlock SC-300 exam-style practice questions.
Practice for SC-300