Confusing ODBC error

  • All:

    I'm in a bit of a bind here: I have two mirrored SQL 2005 servers running SP2, that among other things, run a certain application that requires the ODBC to reference the DB using an IP address, not the DB name (so it can be accessed via separate subnets or while VPN'ing in to the network).

    The problem occurs when I'm trying to set up the ODBC connection - the second server can be accessed by the IP address OR the server name. Great - works like a champ. The first server, however, will only allow me to access it via the server name - not the IP address. Let's just called it DBServer1.

    This issue occurs the same every time, regardless of whether or not I am trying to connect via ODBC, SSMS, etc.

    I do not have a firewall running, named pipes/TCPIP/etc are all enabled. The server/service has been restarted any time changes occur. The settings match on both servers exactly, as far as I can find.

    Can anyone provide any ideas as to why this would occur?

    Thanks,

    Ken

  • Sounds more like a DNS issue than anything to do with mirroring.

    Can you ping the IP address? If you resolve the name of the server (ping -a), is it giving you the expected IP? Does the server have more than one NIC with different IP addresses?

  • Also, you can configure DNS to resolve your server names across the subnets correctly. In fact, it can even be configured to resolve across domain trust relationships if you did not reuse a server name.

  • Michael,

    Good point, and good question - however, DNS resolves the machine name. The server has two NICs, but the other NIC is disabled.

    Let me clarify a bit here:

    1) When I try to connect to the db server from my laptop, on the same subnet, using the server name "DBServer1", I CAN connect. When using the IP address, I cannot resolve or connect to the database.

    2) When opening SMSS, to connect to the server instance from ANY machine, I can not use the IP address, I must use the machine name "DBServer1". (on the same subnet)

    3) Interesting thing: When I create an ODBC connection from my secondary server (DBServer2), and create an ODBC connection to DBServer1, it works using the machine name DBServer1 OR the IP address. So, from server to server, ODBC/SSMS using IP or machine name connections work. From clients, only machine names work. Not the IP address.

    Does that clarify? I have never ran into an issue like this before. I have tried both client drivers (SQL2000:2000.85.1117.0, SQL2000 native client: 2005.90.3042.00), and I can connect via machine name, but NOT with an IP address.

    There is no firewall running, either. It's just strange I can connect to SQL and databases with the machine name, but not the IP address.

    Thoughts?

    -Ken

  • Yes, I understood from the first post. The one server being able to see the other is odd. Check pinging the server name and make sure it resolves to the expected IP address (I am trying to rule out you possibly having type the IP address in wrong or DNS resolving to a second NIC with a different IP).

    Then, try pinging the IP address you are using in your connection string to see if you can ping the server by IP.

  • Michael,

    Good points; I've already ruled those out, too. I checked the HostA records in DNS - they point to the same machine name. I pulled the MAC address from the ethernet port (the other is disabled, just to be certain) and then matched it up on my cisco4506 via the mac-address-table. See attached. I've edited out the first 8 chars of the mac address.

    I'm pretty certain it's not a DNS issue - are there any other permissions in SQL Server that would prevent connections from occuring via an IP address, versus a machine name?

    Thanks,

    Ken

  • Assuming you have TCP/IP connections enabled, the SQL server does not know the difference. I suppose it is possible you are getting names pipes connections by server name. Turn off the named pipes protocol on the server and see if you lost the ability to connect by server name.

  • Michael,

    I've tried everything up to this point that I can think of. So, as a quick resolution to get the rest of the project going, I'm just writing a script to edit client WinXP host files to add lines for the server machines names/IP addresses.

    Thanks for the help,

    Ken

Viewing 8 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic. Login to reply