网络共享中的连接字符串中的名称解析失败 [英] Name resolution in connection string fails from network share

查看:133
本文介绍了网络共享中的连接字符串中的名称解析失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要和网络基础设施人员一起坐下来看看为什么突然发生如下所示的SQL连接错误。

I need to go sit together with the network infrastructure guys to see why suddenly SQL connection errors like below occur.

作为准备,请提供输入为什么会发生此错误,以及我们可以在应用程序和/或基础结构方面尝试采取哪些措施来规避该错误。

As a preparation, please provide input why this error can occur, and which things we could try at the application and/or infrastructure side to circumvent it.


  • 从网络共享启动应用程序时发生错误。

  • 在本地复制文件并在本地启动文件时不会发生此错误。

  • 错误总是可以重现的。

  • 几个星期前(在我去度假之前),它运行良好,所以我不确定何时

  • The error occurs when starting an application from a network share.
  • The error does not occur when copying the files locally and starting it locally.
  • The error is always reproducible.
  • A couple of weeks ago (before I went on holiday) this was running fine so I am not sure when it introduced itself.

现在变得很复杂:


  • 用户在DomainA中

  • 工作站在DomainB中

  • 数据库服务器在DomainB中

  • 数据库登录使用用户名/密码(尚无可信连接)

  • 登录域为DomainA

  • 网络共享位于DomainA中,但作为DFS

  • DomainA和DomainB之间的双向信任

  • 客户端应用程序是x86 Windows 7 Enterprise上的.NET 4(完整框架)

  • 服务器是x64 Windows Server 2008 R2上的SQL Server 2008 R2 Enterprise

  • users are in DomainA
  • workstations are in DomainB
  • database server is in DomainB
  • database login is with user/password (no trusted connection yet)
  • logon-domain is DomainA
  • network share is in DomainA, but as part of a DFS
  • two-way trust between DomainA and DomainB
  • client applications are .NET 4 (full framework) on x86 Windows 7 Enterprise
  • server is SQL Server 2008 R2 Enterprise on x64 Windows Server 2008 R2

ConnectionString像这样:

ConnectionString is like this:

Server=severname.DomainB\InstanceName,48000;Database=DBName;...

尝试了基于IP的ConnectionString li ke在下面,并且行得通,所以这是一个名称解析的事情:

Tried an IP-based ConnectionString like below, and that works, so it is a name resolution thing:

Data Source=IPAddress\InstanceName,48000;Database=DBName;...

由于IP地址可能会更改,因此我们希望保留名称(但IP地址可以工作一段时间)。

我们应该怎么做才能进一步研究名称解析问题?

Since the IP adress might change, we'd like to keep the name (but IP address can work for a while).
What should we do to research furter into the name resolution thing?


为什么从网络共享
开始的名称解析与本地驱动器的名称解析不同?为何过去没有什么不同?

Why is name resolution different when starting from a network share than from a local drive? And why was it not different in the past?

环境已被严格锁定(典型的公司环境),因此简单的调试会很困难。

Environment is pretty locked down (typical corporate environment), so simple debugging can be tough.

IT基础架构人员正在准备将DomainA和DomainB拆分(未来的行动之一:将大量用户从DomainA迁移到DomainB ,然后将DomainB设置为登录域),并尝试对运行的信息产生最小的影响。

The IT infrastructure guys are in the midst of preparing for a split of DomainA and DomainB (one of the future actions: move a big chunk of users from DomainA to DomainB, then making DomainB the logon-domain), and try to have a minimum impact on running information.


与网络相关或与实例相关的建立与SQL Server的连接时发生特定错误。

找不到服务器或无法访问服务器。

验证实例名称正确并且SQL Server已配置为允许远程连接。

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.


推荐答案

现在使用IP地址。如果您确实确实想要在连接字符串中使用一个友好的名称,那么如果您的网络人员无法使用名称解析,请使用 hosts 文件。服务器移动时,您可以更新配置文件以指向新服务器(按名称(如果他们知道届时如何使服务器工作),否则按新IP),或者更新主机文件将旧的友好名称映射到新的IP地址。

Use the IP address for now. If you really, really, really want a friendly name in the connection string, then use the hosts file if your network folks can't get the name resolution working. When the server moves, you can either update the config file to point to the new server (by name, if they figure out how to get it working by then, or by new IP if not), or update the hosts file to map the old friendly name to the new IP address.

我们无法真正告诉您它为什么更改或为什么更改已损坏-一旦您向网络小组提供证据,例如能够通过IP地址但不通过名称远程登录到端口48000上的计算机,您应该从网络团队那里得到更好的答案。他们可能不知道此修复程序,但最好在 ServerFault 上询问具体情况。

We can't really tell you why it changed or why it is broken - you should get a better answer from your network team once you provide them evidence such as being able to telnet to the machine on port 48000 by IP address but not by name. They might not know the fix but that specific case is probably better asked on ServerFault.

这篇关于网络共享中的连接字符串中的名称解析失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆