Static Web Apps: Custom domain linking issue — domain not found error

AkashPoojary-7813 0 Reputation points
2026-08-28T16:16:44.22+00:00

Problem description

I am experiencing issues when trying to link my custom domains, kritivak.com and petfrnd.com, to my Azure Static Web App. The add domain flow fails immediately with the error message: "domainName is invalid. The domain name given was not found." Despite removing all DNS records related to previous subscriptions and confirming that the DNS is active and resolving correctly, I am unable to complete the domain linking process.

Environment

Azure Static Web Apps service, custom domains, located in the affected region is not specified in the case information.

What I've already tried

I have removed all DNS records associated with previous subscriptions for both domains. I have verified that the DNS is active and resolving correctly by checking the authoritative nameservers and public resolvers. I have attached proof that the DNS is active and functioning properly.

Current status

I am seeking assistance to identify the cause of the domain linking failure and guidance on resolving the "domain not found" error to successfully link my custom domains to the Azure Static Web App.

Azure Static Web Apps
Azure Static Web Apps

An Azure service that provides streamlined full-stack web app development.

0 comments No comments

3 answers

Sort by: Most helpful
  1. TP 163K Reputation points Volunteer Moderator
    2026-08-28T18:51:48.1766667+00:00

    Hi Akash,

    Were these domains previously linked to static web app or app(s) in different subscription, and you removed them from that subscription?

    I did quick check and I see for kritivak.com you have TXT for @ of _m0iqmom66k93l1mz9pq1otla8dpdhvo and for petfrnd.com you have TXT for @ of azure-validation-temp. Please delete these two TXT records from DNS.

    1. Please add DigiCert CAA record for your apex domains. It should be: 0 issue "digicert.com" You may use dig in Azure Cloud Shell to verify it is correct with command similar to below:

    dig kritivak.com caa
    
    

    Output similar to below:

    ;; ANSWER SECTION:
    kritivak.com.            3600    IN      CAA     0 issue "digicert.com"
    
    

    Please add CAA record for petfrnd.com and verify using dig as you did above for kritivak.com

    2. Delete custom domain kritivak.com from your Static Web App (if it exists).

    3. Wait 30 minutes (for TTL to expire on TXT record)

    4. In Azure portal, add kritivak.com as custom domain to your Static Web App, generate new code for TXT record, be ready to immediately create TXT record. If generate code fails for some reason please post error in comment and screenshot if possible.

    5. Quickly add _dnsauth TXT record with new code, with low TTL (e.g. 300 seconds) in your DNS provider's portal. Note this is different than creating @ TXT record, which is what portal will show. DNS record similar to below:

    Type: TXT

    Host: _dnsauth

    Value: <generated code>

    TTL: 300 (5 minutes)

    6. Refresh in portal every 5 minutes to see if validation is complete. If it doesn't complete within 15 minutes there is an issue, add comment below

    Please reply back here with your results, whether positive or negative.

    Custom domains with Azure Static Web Apps - Zero downtime migration

    https://learn.microsoft.com/en-us/azure/static-web-apps/custom-domain#zero-downtime-migration

    Thanks.

    -TP

    Was this answer helpful?


  2. Akash Poojary 0 Reputation points
    2026-08-28T18:07:13.4466667+00:00

    I have already raised a support ticket to get them unlink the orphaned record but they are stating there is no issue at their end. Just to state something,
    az staticwebapp hostname show -n kritivak -g kritivak-rg --hostname dev.kritivak.com --query "validationToken" -o

    This does generate validation token. Just that the kritivak.com and www.kritivak.com is not letting me generate validation token.

    Was this answer helpful?


  3. Allan Solomon Mejia 7,585 Reputation points
    2026-08-28T16:43:26.84+00:00

    Hello @AkashPoojary-7813

    Since both domains were previously associated with other Azure subscriptions/resources, this likely isn't a DNS propagation issue.

    Azure Static Web Apps requires a custom domain to be uniquely associated with a Static Web App. Microsoft specifically documents that a domain already bound to another Static Web Apps resource must first be disassociated from the original resource before it can be attached to another instance.

    Removing the old DNS records does not remove Azure's internal custom-domain association. There are documented cases where the old Static Web App/subscription was deleted or became inaccessible, but the hostname remained registered on the Azure side, and attempts to reuse it produced:

    domainName is invalid. The domain name given was not found.

    That appears consistent with your situation.

    First, check whether either domain is still attached to any Static Web App you can access:

    az staticwebapp list --query "[].{Name:name,ResourceGroup:resourceGroup}" -o table
    az staticwebapp hostname list \
      --name <static-web-app-name> \
      --resource-group <resource-group>
    

    If neither kritivak.com nor petfrnd.com appears on any accessible resource, try adding one through the CLI with debug logging. This can expose a more useful backend error than the portal:

    az staticwebapp hostname set \
      --name <static-web-app-name> \
      --resource-group <resource-group> \
      --hostname kritivak.com \
      --validation-method dns-txt-token \
      --debug
    

    If Azure still has the hostname associated with an old or inaccessible subscription, you can't change a DNS record to release that Azure-side binding. At that point, I recommend opening an Azure support request and asking Microsoft to investigate/release the stale Static Web Apps custom-hostname association. Include the two domain names, current Static Web App resource ID, previous subscription/resource details if available, and the correlation/error details from the CLI --debug output.

    For the final configuration, since these are apex/root domains, Microsoft supports validating ownership with a TXT record and then routing the domain using an appropriate ALIAS, ANAME, CNAME flattening, or A record, depending on your DNS provider. Apex-domain DNS changes can take up to 72 hours to propagate.

    In this case, don't keep deleting or recreating DNS records. If public DNS is already healthy and the portal fails before it can generate the TXT validation token, I'd start by investigating the previous Azure-side domain association.

    Sharing these references with you:

    Custom domains with Azure Static Web Apps

    Configure an apex domain with external DNS

    Help make this community better for everyone: if this answer resolved your issue, please accept it or leave an upvote. If not, share more details in a comment so we can continue the discussion and find the right solution.

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.