Can Microsoft 365 Create DNS A Records Programmatically?
Question details
The user wants to create or update a domain's DNS A record programmatically when a server's IP address changes.

- Product
- Microsoft 365 domain and DNS management
- Device & OS
- not provided
- Scenario
- A domain is configured for Microsoft 365, and a server's A record needs to be updated when its IP address changes.
- Observed behavior
- The A record can be updated manually, but Microsoft 365 does not generally provide an API or PowerShell cmdlet for managing arbitrary DNS A records.
Identify the authoritative DNS provider for your domain and the hostname and IP address you need to update. If the server must be reachable from the public internet, use its public IP address; addresses in the 10.0.0.0/8 range are private.
Update the A record manually with your DNS provider
Use this approach when IP changes are infrequent and manual DNS updates are acceptable.
Sign in to the portal of your authoritative DNS provider and open DNS management for your domain. If your Microsoft 365 portal provides DNS editing for the domain, open Settings > Domains and select the domain.
Find the A record for the hostname, select Edit, and replace its address with the new IP address.
Select Save, then use a DNS lookup tool such as nslookup to check that the hostname resolves to the new address. Cached results may persist until the record's TTL expires.

Use a DNS provider with an API for automated updates
Use a programmable DNS hosting service when the A record must be updated automatically.
Use WPS Office for Everyday Office Work
WPS Office is a free, lightweight alternative with a familiar interface and Microsoft Office format compatibility for an easier transition. DNS A records must still be managed through your DNS provider.

Frequently Asked Questions
Can Microsoft 365 PowerShell update arbitrary DNS A records?
Microsoft 365 does not generally provide a PowerShell cmdlet for managing arbitrary A records. Use the authoritative DNS provider's PowerShell module or API instead.
Where do I change an A record manually?
Sign in to the authoritative DNS provider's portal, open DNS management for the domain, and edit the A record for the hostname. A Microsoft 365 portal may offer DNS editing for some domain configurations.
Can I use a 10.x.x.x address for a public server's A record?
A 10.x.x.x address is private and is not directly routable on the public internet. For public access, point the A record to the server's public IP address and configure any required network routing.
Why does the old IP address still appear after I update the record?
DNS resolvers may cache the old answer until the record's TTL expires. Use a DNS lookup tool to check the authoritative response and allow time for cached results to refresh.




