Hello Emmanuel,
Thank you for your question and for reaching out with your question today.
The error message "SocketException: Unknown host" indicates that your application is unable to resolve the hostname "adfs.labmait.local" to an IP address. This typically happens when the hostname cannot be found in the DNS server configured on the machine running your ASP.NET Core MVC application.
To resolve this issue, you need to ensure that your application server can resolve the ADFS server's hostname. Here are some steps you can take to troubleshoot and fix the issue:
1. **Check DNS Configuration**: Verify that the DNS settings on your application server are correctly configured. Ensure that the DNS server used by your application server can resolve the hostname "adfs.labmait.local" to its correct IP address.
2. **Hosts File Entry**: As a temporary solution for testing purposes, you can add an entry to the hosts file on your application server. The hosts file allows you to manually map IP addresses to hostnames. Open the hosts file (located at "C:\Windows\System32\drivers\etc\hosts" on Windows) and add the following line:
<ADFS_SERVER_IP> adfs.labmait.local
Replace `<ADFS_SERVER_IP>` with the actual IP address of your ADFS server. Save the hosts file and try running your application again.
3. **Verify Connectivity**: Ensure that your application server can reach the ADFS server over the network. You can use tools like "ping" or "telnet" to test network connectivity to the ADFS server's IP address and port (443).
4. **Firewall Settings**: Check the firewall settings on both your application server and the ADFS server. Make sure that port 443 (HTTPS) is open and allowed for communication between the two servers.
5. **ADFS Metadata Address**: Double-check that the ADFS Metadata Address specified in your application's configuration is correct. Ensure that it is accessible from the application server.
6. **URL Encoding**: If your ADFS Metadata Address contains any special characters, ensure that it is properly URL encoded in your application's configuration.
7. **Application Pool Identity**: Ensure that the application pool identity under which your ASP.NET Core application runs has network access permissions to reach the ADFS server.
8. **Check for Typos**: Review your code for any typos or mistakes in the ADFS Metadata Address or realm configuration.
After making any changes, be sure to restart your ASP.NET Core application to apply the updates.
If you still encounter issues after verifying the above steps, consider consulting with your network or system administrator for further assistance in resolving DNS and network connectivity problems. Additionally, check the ADFS server's logs and event viewer for any errors or warnings that might provide more insights into the issue.
I used AI provided by ChatGPT to formulate part of this response. I have verified that the information is accurate before sharing it with you.
If the reply was helpful, please don’t forget to upvote or accept as answer.
Best regards.