How to Fix getaddrinfo EAI_AGAIN on QuickServer

Troubleshoot the getaddrinfo EAI_AGAIN error on QuickServer when DNS, default gateway, or internet reachability prevents the gateway from resolving a hostname.

Overview

If a QuickServer log shows getaddrinfo EAI_AGAIN <hostname>, the gateway tried to resolve a host name and the DNS lookup failed or timed out. In practice, this usually means the QuickServer does not have a working path to a DNS server or cannot reach the named host from its own network position.

This is commonly seen when the QuickServer is connecting to an internet-hosted service or to an OPC UA endpoint configured with a domain name instead of a direct IP address.

[!NOTE] EAI_AGAIN is a name-resolution problem. It usually points to DNS, default gateway, routing, or hostname accuracy rather than to the protocol mapping itself.

Example Error

The error may appear in logs like this:

2018-10-31 02:48:01.998 [ INFO] -    68ms (opcuaDriver) opcuaClient: GetClient: connecting to:  opc.tcp://opcua.demo-this.com:51210/UA/SampleServer
09:48:02.905Z :verify                        :49    [NODE-OPCUA-W06] The certificate subjectAltName does not match the client applicationUri
...                                                Please regenerate a specific certificate that matches your client applicationUri
...                                                certificate subjectAltName  = urn:PA2:NodeOPCUA-Client
...                                                client applicationUri  = urn:2E2C:NodeOPCUA-Client
...                                                certificateFile         = /fst/documents/opcuaDriver/certificates/PKI/own/certs/client_certificate.pem

2018-10-31 02:48:28.901 [ERROR] - 26903ms (opcuaDriver) opcuaClient: GetClient: connection error:  Error: The connection may have been rejected by server,
Err = (getaddrinfo EAI_AGAIN opcua.demo-this.com)

In this example, the important part is getaddrinfo EAI_AGAIN opcua.demo-this.com. The QuickServer could not reliably resolve opcua.demo-this.com.

[!WARNING] If the same log also shows certificate warnings, treat them as separate issues. Fix the hostname resolution problem first. After that, address any remaining certificate or endpoint-identity errors.

What Usually Causes It

SymptomLikely CauseAction
getaddrinfo EAI_AGAIN <hostname> appears immediately when the driver startsDNS server is missing, wrong, or unreachableVerify DNS1, DNS2, subnet mask, and default gateway on the QuickServer
The hostname works from a laptop but not from the QuickServerThe laptop is on a different network path or has different DNS accessTest from the same subnet or VLAN as the QuickServer, not from an unrelated engineering PC
The site uses DHCP and the error is intermittentDHCP handed out a bad gateway or unusable DNS serverReview the leased network settings and correct DHCP scope or use valid static DNS values
The gateway has valid IP settings but still cannot resolve the hostThe domain name is wrong or the upstream network blocks access to itRecheck the exact hostname and confirm the site firewall or router allows the QuickServer to reach it
The job uses an internet-hosted endpointThe QuickServer has no internet path from that site networkProvide the QuickServer with internet access or expose the target through a host name the QuickServer can resolve internally

Diagnostic Flow

  1. Confirm the configured hostname exactly matches the intended endpoint. A simple spelling error can produce EAI_AGAIN.
  2. Review the QuickServer network settings: IP address, subnet mask, default gateway, DNS1, and DNS2.
  3. If the unit uses DHCP, check what gateway and DNS server were actually leased.
  4. Verify the same hostname can be resolved from another device on the same network segment as the QuickServer.
  5. Confirm the QuickServer network is allowed to reach that domain. If the endpoint is on the internet, the site must provide outbound access.
  6. Reload the configuration or restart the affected service and watch for the error to clear.

Resolution

The fix is usually one of these:

  1. Correct the QuickServer default gateway.
  2. Correct the QuickServer DNS server addresses.
  3. Restore real network or internet access to the QuickServer.
  4. Correct the configured host name if it was entered incorrectly.
  5. Make the configured domain reachable from the QuickServer network.

If the integration allows a direct IP address, testing with an IP can help prove the problem is DNS-related.

[!WARNING] For secure OPC UA connections, replacing a hostname with an IP address can create a separate certificate or endpoint-identity mismatch. Only keep the IP-based change if the server configuration and certificate model support it.

Validation

After the fix:

  • The log should stop showing getaddrinfo EAI_AGAIN.
  • The QuickServer should reach the configured endpoint without a hostname-resolution error.
  • The downstream protocol session should move on to the next real step, such as successful connection, browse, or data exchange.
  • If certificate or application URI warnings remain in an OPC UA project, troubleshoot those separately after DNS is working.