Thank you for posting your query on Microsoft Q&A, from above description I could understand that you are trying to getting "Unable to find target address" while trying to execute "New-MgDomainFederationConfiguration" .
Please do correct me if this is not the ask by responding in the comments section:
I am assuming this is due to the personal/live account you have been using to authenticate. As per New-MgDomainFederationConfiguration permissions Delegated (personal Microsoft account) is Not supported and this requires a work/school account.
Solution: Create a user within your Entra ID tenant and elevate it to global admin user and when prompted to authenticate to Microsoft Entra ID, use the credentials of this account as it would have Global Administrator role while running the PowerShell session script.
Also make sure you are fulfilling the prerequisite 1:
A Microsoft Entra tenant, with one or multiple custom DNS domains (that is, domains that aren't in the format *.onmicrosoft.com)
- If the federated domain hasn't yet been added to Microsoft Entra ID, you must have access to the DNS domain to create a DNS record. This is required to verify the ownership of the DNS namespace
- Learn how to Add your custom domain name using the Microsoft Entra admin center
Please "Accept the answer (Yes)" and "share your feedback ". This will help us and others in the community as well.
Thanks,
Akshay Kaushik