How to Change DNS on Microsoft Azure & Entra ID
By [FILL IN], [FILL IN] · Last updated
Entra ID (formerly Azure AD) is an identity service and has no DNS settings of its own. DNS for Azure workloads is configured on the virtual network (VNet), on domain controllers running in Azure, on Microsoft Entra Domain Services, or through Azure DNS Private Resolver. Pick the scenario that matches your setup.
Before you start
You need a FirewallDNS account (see pricing). Sign in to your dashboard, register your public IP address and copy your DNS server addresses. Replace <FIREWALLDNS-PRIMARY> and <FIREWALLDNS-SECONDARY> below with them.
Step by step
- Find the public outbound IP of your Azure resources (NAT Gateway, Azure Firewall or VM public IP) and register it in the FirewallDNS dashboard.
- Scenario A, VMs without AD: open Virtual networks > your VNet > DNS servers, choose Custom and enter <FIREWALLDNS-PRIMARY> and <FIREWALLDNS-SECONDARY>. Save, then restart the VMs (or renew DHCP) to pick up the change.
- Scenario B, domain controllers in Azure: keep the VNet DNS servers pointing to the DC private IPs. On each DC, set the DNS forwarders to FirewallDNS exactly as in the Active Directory guide.
- Scenario C, Microsoft Entra Domain Services: the managed DCs forward to Azure DNS and cannot be changed in the portal. From a domain-joined management VM with RSAT, open DNS Manager, connect to the managed domain and change Forwarders to FirewallDNS (members of AAD DC Administrators have this right).
- Scenario D, Azure DNS Private Resolver: create an outbound endpoint, then a DNS forwarding ruleset with a wildcard rule for "." pointing to <FIREWALLDNS-PRIMARY> and <FIREWALLDNS-SECONDARY> on port 53. Link the ruleset to your VNets. Add more specific rules for privatelink and internal zones first.
- If you use Azure Firewall as DNS proxy: Firewall Policy > DNS > Custom DNS servers, add the FirewallDNS addresses and enable DNS proxy.
- Verify from a VM: nslookup example.com and check the live log in the FirewallDNS dashboard.
Azure CLI
# Scenario A: set custom DNS on a VNet
az network vnet update -g MyRG -n MyVNet --dns-servers <FIREWALLDNS-PRIMARY> <FIREWALLDNS-SECONDARY>
# Scenario D: Private Resolver wildcard forwarding rule
az dns-resolver forwarding-rule create -g MyRG \
--ruleset-name MyRuleset --name all-internet \
--domain-name "." --forwarding-rule-state Enabled \
--target-dns-servers '[{"ip-address":"<FIREWALLDNS-PRIMARY>","port":53},{"ip-address":"<FIREWALLDNS-SECONDARY>","port":53}]'Good to know
- Keep Azure private DNS zones (privatelink.*) resolving via Azure DNS 168.63.129.16 with specific rules, or Private Endpoints will break.
- Entra-joined Windows devices outside Azure use the DNS of the network they are on. Protect them via the router guides or Intune: configure DNS over HTTPS with a Settings Catalog policy.
Verify it works
- Renew DHCP on a client (Windows:
ipconfig /renew, macOS: reconnect Wi-Fi). - Run
nslookup example.comand check which server answered. - Open the live log in your dashboard. New lookups should appear within seconds.