"No such host is known" when trying to connect to a UA Server with OPC Data Client
I am getting a "No Such host is Known" when trying to connect to my OPC UA Server with OPC Data Client. What could be a cause of this?
OPC Data Client attempts to discover all the endpoints of an OPC UA server when trying to establish a connection to the server. The OPC UA server that it is trying to connect to is responsible for returning a list of accessible endpoints that the client can choose from.
Some OPC UA servers may return back their local machine name in the endpoint URL ("opc.tcp://mylocalname:48390"), which can cause a problem if the OPC Data Client is located outside of the local network of the OPC UA server. In this case, it will give an error stating: "No such host is known" after attempting to connect.
In order for the OPC Data Client to try to cope with this situation, it can try replacing the domain name specified in the endpoints returned by the server with the host name of the original discovery endpoint. This can be done by setting the EasyUAClient.IsolatedParameters.Session.EndpointSelectionPolicy.EnforceSameSite property to true. In versions of the OPC Data Client previous to 5.32, this setting was false by default. From 5.32 on, this setting will default to true.
Example:
Let us assume that you are wanting to connect to a TOP Server at the endpoint "opc.tcp://myhost.mydomain.com:49380". This TOP Server is not on the same local network as the OPC Data Client. When attempting to connect, the TOP Server returns back "opc.tcp://mylocalname:48390" as one of its available endpoints. The OPC Data Client would then attempt to connect to a computer on its network called "mylocalname", which does not exist. If EnforceSameSite was set to true, instead of doing this, the OPC Data Client would ignore "mylocalname" and replace it with "myhost.mydomain" when attempting to connect and the connection would succeed.