Skip to main content

SQL Server | Error Locating Server/Instance Specified

Error Locating Server/Instance Specified, Connectivity test failed. Exception: A network-related or instance-specific error occurred while establishing a connection to SQL Server, SQL Serve

Updated over a week ago

Overview πŸ’₯

This article helps troubleshoot the following Microsoft SQL Server inspection error seen in Liongard when the SQL Server Inspector cannot connect to the specified SQL Server instance during the connectivity test.

Error Message:

Connectivity test failed. Exception: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)

This error most commonly appears when a named SQL instance is configured incorrectly or cannot be reached from the Liongard Agent.


Why This Happen? πŸ€”

This is a standard Microsoft SQL Server connectivity error that occurs when the Liongard Agent cannot resolve, locate, or connect to the SQL instance.

Common Root Causes

Cause

Explanation

Incorrect instance name

Instance name is not in hostname\instance format or contains a typo

SQL Server Browser service stopped

Required to locate named instances

Remote connections disabled

SQL Server does not allow external connectivity

Firewall blocked

TCP 1433 or dynamic ports are not allowed

DNS / network issues

Agent cannot resolve the SQL host

Instance offline

SQL services are stopped

Dynamic ports

Named instances often use random ports not allowed in firewall


Steps to Resolve πŸ‘¨β€πŸ’»

1️⃣ Validate Instance Name Format

Scenario

Action

Default instance

Leave the instance field blank (uses MSSQLSERVER)

Named instance

Use hostname\instance (example: sql01\SQLEXPRESS)

2️⃣ Verify SQL Server Services

On the SQL Host:

  • Open SQL Server Configuration Manager

  • Confirm the following services are running:

Service Name

Required

SQL Server (InstanceName)

βœ… Yes

βœ… Required only for named instances

3️⃣ Enable Remote Connections

  • Go to SQL Server Network Configuration.

  • Navigate:

    • SQL Server Network Configuration

    • Protocols for InstanceName

  • Ensure TCP/IP is enabled.

  • Restart the SQL Server service after changes.

4️⃣ Check Firewall Settings

Instance Type

Port Requirement

Default instance

TCP 1433

Named instance

Dynamic (must be identified manually)

If using named instances:

  • Identify the assigned port.

  • Open the port in the firewall.

  • Consider configuring a static port.

5️⃣ Test Connectivity from Agent Machine

From the Liongard Agent host, run:

sqlcmd -S hostname\instance
ping hostname
nslookup hostname

or test port connectivity:

telnet hostname 1433

If DNS fails, test using IP address.

6️⃣ Verify SQL Browser Service (Named Instances Only)

Named instances require SQL Server Browser.

Requirement

Status

SQL Browser Running

Must be βœ…

UDP 1434 Allowed

Must be βœ…

If disabled, the named instance will not resolve.

7️⃣ Update Liongard Agent

Ensure the Liongard Agent is up to date.


Troubleshooting Flow πŸš€

Symptom

Likely Cause

Action

Cannot locate instance

Browser service stopped

Start SQL Browser

Works with IP but not hostname

DNS issue

Fix DNS or use IP

Works locally but not from Agent

Firewall issue

Open required port


Best Practices / Prevention πŸ˜‰

Recommendation

Benefit

Use static ports for named instances

Stable firewall rules

Document ports and instance names

Faster recovery

Avoid Browser dependency where possible

Reduced attack surface

Keep SQL and Agent updated

Compatibility and security


When to Contact Support 🦁

Only contact Liongard Support after completing all troubleshooting steps.

Provide the Following

Required Data

Reason

Inspector debug logs

Shows connection failures

sqlcmd and other command results

Confirms connectivity

SQL Config screenshots

Validates services

Firewall rules

Confirms access


Third-Party Link Disclaimer ‼️

We may reference external third-party resources solely as additional guidance.

Liongard does not own, control, or guarantee the accuracy, security, or reliability of third-party sites. Please use them at your own discretion and risk.


References πŸ“š

Did this answer your question?