If you’re planning on working with Sitecore 10.3 locally, you may run into issues when setting up a Docker container. One problem you might encounter when setting up Sitecore Docker is when trying to pull packages down, such as the .NET SDK, you might get an error that says “The remote name could not be resolved.” In this post, we’ll go over a solution to this issue that involves configuring the priority of your network adapters.
Check your current state
The first step to resolving this issue is to check the current state of your network adapters. In Windows PowerShell, you can run the following command:
Get-NetIPInterface -AddressFamily IPv4 | Sort-Object -Property InterfaceMetric -Descending
This command will show you a list of your network adapters, sorted by interface metric. The interface metric is a value that determines the priority of the adapter. The lower the interface metric, the higher the priority.
If you have multiple networking adapters (Ethernet, Wi-Fi, etc.) present on the host, you need to configure the priority of these adapters properly in order for the Windows networking stack to correctly choose gateway routes.
Update your priorities
XM Cloud Roadmap Guide
XM Cloud is the future of enterprise content management offerings. The new sites, pages, and components tools offer an efficient content author experience that is not available with other CMS systems.
To change the priority of your adapters, you can use the following command:
Set-NetIPInterface -InterfaceAlias 'Wi-Fi' -InterfaceMetric 3
This command sets the interface metric for the Wi-Fi adapter to 3, which made it the primary adapter for network traffic for me as my Ethernet was set to 5. It’s important to note that if you have multiple virtual switches set up, you should set the interface metric for each switch accordingly. Here’s what mine looked like after that update:
Verify your connectivity updates
After making these changes, you should verify the state of your routing tables by running the following command:
Get-NetRoute -AddressFamily IPv4
This command will show you the state of your routing tables, including the gateway address for your primary adapter:
If you’re having trouble with Docker connectivity, it’s possible that the priority of your network adapters needs to be configured properly. By using the commands outlined in this post, you can set the priority of your adapters and verify that traffic is being routed correctly.