Error: Unable to Connect to API: UnknownHostException
Issue
Connection tests fail with the following error:
Unable to connect to API java.net.UnknownHostException: <instance_id>.service-now.com
Environment
Connector: ServiceNow
Resolution
To resolve this issue:
- In Fivetran, go to your ServiceNow connection page.
- Go to the Settings tab.
- Click Edit connection.
- In the Instance ID field, enter the full instance URL, including the
https://protocol. For example:https://fivetran.servicenowservices.com - Click Save & Test.
Cause
This issue occurs when you enter only an instance identifier, such as fivetran, in the Instance ID field for a ServiceNow instance that uses a custom domain.
The Instance ID field supports two formats:
- For instances that use the standard
service-now.comdomain, enter the instance identifier. For example,fivetrancorresponds tohttps://fivetran.service-now.com. - For instances that use a custom domain, enter the full instance URL. For example,
https://fivetran.servicenowservices.com.
When you only enter an instance identifier, we assume that the instance uses the standard service-now.com domain and constructs the endpoint accordingly. If your instance uses a custom domain, the generated hostname doesn't match the actual instance URL, causing DNS resolution to fail.