SQL Server error 1418 means the server network address you specified in a database mirroring or availability group endpoint cannot be reached. The fix is to verify the endpoint URL, ensure the SQL Server service is running and listening on the correct port, and confirm that Windows Firewall and network routing allow traffic between the replicas. Start by checking the endpoint configuration on both servers, then test connectivity with telnet or Test-NetConnection, and finally review the SQL Server error log for the exact connection failure.

What You'll Need

  • Administrative access to both SQL Server instances (or the primary and secondary replicas).
  • SQL Server Management Studio (SSMS) or sqlcmd connected to each instance.
  • Windows Firewall access or coordination with your network team.
  • The exact endpoint URL used in the mirroring or availability group configuration.
  • Permission to run telnet, Test-NetConnection, or ping from each server.

Step-by-Step

  1. Identify the exact endpoint URL. In SSMS, run SELECT name, role_desc, state_desc, endpoint_url FROM sys.database_mirroring_endpoints; on both instances. The endpoint_url column shows the TCP address (for example TCP://ServerA.domain.com:5022). Note the hostname and port. If the URL uses an IP address, consider switching to a fully qualified domain name (FQDN) to avoid DNS resolution issues.
  2. Confirm the SQL Server service is running and the endpoint is started. Run SELECT state_desc FROM sys.database_mirroring_endpoints; and ensure it returns STARTED. If it returns STOPPED, run ALTER ENDPOINT [Mirroring] STATE = STARTED; (replace the endpoint name if different). Also check that the SQL Server service is running in Services.msc and that the endpoint port is not blocked.
  3. Test network connectivity from each server to the other. Open Command Prompt or PowerShell on Server A and run Test-NetConnection -ComputerName ServerB.domain.com -Port 5022. Repeat from Server B to Server A. If the test fails, the problem is network-related (firewall, routing, or DNS). If it succeeds, move to the next step.
  4. Check Windows Firewall rules on both servers. Open Windows Defender Firewall with Advanced Security and look for inbound rules allowing TCP traffic on the endpoint port (default 5022). If no rule exists, create one: New Rule > Port > TCP > Specific local ports: 5022 > Allow the connection > Apply to Domain, Private, and Public as needed. Also ensure outbound rules are not blocking the traffic.
  5. Verify DNS resolution. On each server, run nslookup ServerB.domain.com and confirm it resolves to the correct IP address. If it fails, fix DNS or use a hosts file entry temporarily. Incorrect DNS is a common cause of error 1418 because the endpoint URL uses a hostname that does not resolve from the partner server.
  6. Check SQL Server error logs for the exact failure. In SSMS, expand Management > SQL Server Logs, or query sys.dm_os_ring_buffers for connectivity errors. Look for messages like "A connection attempt failed because the connected party did not properly respond" or "No such host is known." These point to firewall, DNS, or service issues.
  7. Recreate or alter the endpoint if the URL is wrong. If the endpoint URL uses an incorrect hostname or port, you may need to drop and recreate the endpoint. Warning: dropping an endpoint stops mirroring or availability group traffic. Back up your databases and configuration first. Use ALTER ENDPOINT ... AS TCP (LISTENER_PORT = 5022); to change the port, or drop and recreate with the correct URL.
  8. Restart the SQL Server service on both instances. After firewall or endpoint changes, restart the SQL Server service (SQL Server Configuration Manager > SQL Server Services > right-click > Restart). Then re-run the connectivity test and retry the mirroring or availability group operation.

Common Mistakes

  • Using an IP address in the endpoint URL that changes (DHCP) instead of a static IP or FQDN.
  • Forgetting to open the firewall port on the secondary server as well as the primary.
  • Assuming the endpoint is started when it is actually stopped after a service restart.
  • Testing connectivity with ping only; ICMP may be blocked while TCP works, or vice versa. Always test the specific TCP port.
  • Changing the endpoint URL without updating the mirroring or availability group configuration, which leaves the old URL in place.

Tips

  • Use fully qualified domain names (FQDNs) in endpoint URLs to avoid DNS suffix issues.
  • Document the endpoint port and firewall rules for each replica to speed future troubleshooting.
  • Enable SQL Server error logging to capture connection failures with timestamps.
  • If you use a non-default port, ensure all replicas and firewall rules reference the same port.
  • Consider using a dedicated network interface for mirroring traffic to isolate it from client traffic.

Troubleshooting

If the steps above do not resolve error 1418, work through these checks in order:

  • Check the SQL Server Browser service. If you use a named instance, the Browser service must run on the target server to resolve the port. Start it in Services.msc.
  • Verify the endpoint is not using a port already in use. Run netstat -ano | findstr :5022 to see if another process is listening. If so, choose a different port and update the endpoint and firewall rules.
  • Review Windows event logs. Look for TCP/IP or firewall-related errors in the System log that coincide with the connection attempt.
  • Test with telnet from the partner server. If Test-NetConnection succeeds but telnet fails, the issue may be client-side or a proxy. Use telnet ServerB.domain.com 5022 from Server A.
  • Check for antivirus or third-party firewalls. Some security software blocks SQL Server ports. Temporarily disable (for testing only) and re-test, then add an exclusion.
  • Ensure the SQL Server service account has network access. If the service runs under a local account, it may not have permission to listen on the network. Use a domain account or Network Service.
  • If all else fails, recreate the endpoint and mirroring configuration. Back up first. Drop the endpoint, recreate it with the correct URL, and reconfigure mirroring or the availability group. This is a last resort but resolves persistent configuration corruption.

Frequently Asked Questions

What does error 1418 actually mean?

It means SQL Server could not reach the network address specified in the endpoint URL during a mirroring or availability group operation. The error is a connectivity failure, not a database corruption issue.

Can error 1418 occur if the firewall is open?

Yes. DNS resolution failures, a stopped endpoint, or an incorrect port in the URL can cause it even when the firewall allows traffic.

Do I need to restart SQL Server after changing the endpoint?

Not always, but restarting the SQL Server service ensures the endpoint rebinds to the new port or URL. It is a safe step after configuration changes.

Is error 1418 specific to database mirroring?

It appears most often in database mirroring and Always On availability group setups, but the same connectivity principles apply to any SQL Server endpoint communication.

Can I use an IP address instead of a hostname in the endpoint URL?

You can, but it is not recommended because IP addresses can change. Use a static IP or, better, a fully qualified domain name that resolves correctly from all replicas.

What port should I use for the mirroring endpoint?

The default is 5022, but you can use any available TCP port. Ensure the same port is open in the firewall and specified consistently in all endpoint URLs.