Connect to sever by name rather than IP address

  • Hi

    When i first open SSMS the 'Connect to Server' logon box appears. In it the server name drop down box is a whole bunch of different ip address of all the servers we use in our production environment. If i click 'cancel' the 'Connect to server' box goees away and i am left with ssms open, and, at the bottom left i can see my 'Registered servers tab' and my 'Object Explorer' tab.

    In the Registred servers tab is a list of servers by name which is far more easier when i need to connect to the required server.

    The problem is when i want to change connection by clicking the 'Connect Object explorer' it opens up the 'Connect to Server' box again with all the IP address.

    I have tried typing in the names of the servers in replacement of the ip address but it fails to connect.

    How do i get this list of ip address to display the server names so its easier to switch when i want to connect ?

    This is probably really basic but its one of those things you probably only set up once and then its done ! Any tips ?

  • What is the error message when it fails to connect?

    Can you ping the server(s) by name?

  • I can actually connect via the ip address so network connectivity is fine. I just wish to connect via the name though.

    I just type in the server name in the server name box - do i need a fully qualified domain name perhaps (this has just occured to me !) ?

    The error i get is :

    annot connect to SERVERXXXXX.

    ------------------------------

    ADDITIONAL INFORMATION:

    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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 53)

    For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=53&LinkId=20476

  • I asked if you could ping the server(s) by name to verify that the DNS was working.

    By the additional information I see that it tries to connect via Named Pipes and not TCP/IP. If you specify a fully qualified domain name it should work.

  • There could be a lot of things going on. If you double-click on one of your registered servers that are listed by name does it connect successfully? If so I would take a look at the properties of the registered server. You could have something like SQL listening on a specific IP that is not registered to a host name in DNS so when the server is added to registered servers it just lists the server name in the label, but it is still using the IP address to do the actual connection.

    Joie Andrew
    "Since 1982"

  • ahh Sorry i misunderstood. Presumed you meant ping by IP.

    No i cannot ping by the server name but i can ping by ip.

    I will try a FQDN and see if that works....

  • No i cannot ping by the server name but i can ping by ip

    Are these servers in a production environment? It sounds like their hostnames are not registered in DNS. If you cannot ping them by name that sounds like a name resolution issue.

    Have you ever been able to ping them or connect in SSMS to them by name?

    Joie Andrew
    "Since 1982"

  • These servers are in a production environment. I am not sure if these have been able to connect via name previoulsy as i am new here.

    I have just managed to ping by typing

    Ping Servername.domain

    However when i use the same format in the 'connect to server' box in ssms i get the same error as i posted a while back

  • So you can successfully ping by server name, or you can't? If you can ping by server name now try connecting by name again in ssms.

    Joie Andrew
    "Since 1982"

  • If you can ping the server by name, then DNS is resolving the name, but SQL Server might be configured to allow connections only on a specific port. If so, you'll need to include it when connecting via SSMS. If you don't have this, the DBA should be able to provide you with the information.

  • If you can ping the server by name, then DNS is resolving the name, but SQL Server might be configured to allow connections only on a specific port. If so, you'll need to include it when connecting via SSMS. If you don't have this, the DBA should be able to provide you with the information.

    I totally agree with this except for the fact that the OP said he was able to connect via IP fine and did not mention anything about specifying port numbers when he connected with IP. If he was able to connect by IP and not specify a port then name should be fine as well, unless the name cannot be resolved or the server name changed and he did not update SQL appropriately.

    Joie Andrew
    "Since 1982"

  • Joie Andrew (7/31/2013)


    If you can ping the server by name, then DNS is resolving the name, but SQL Server might be configured to allow connections only on a specific port. If so, you'll need to include it when connecting via SSMS. If you don't have this, the DBA should be able to provide you with the information.

    I totally agree with this except for the fact that the OP said he was able to connect via IP fine and did not mention anything about specifying port numbers when he connected with IP. If he was able to connect by IP and not specify a port then name should be fine as well, unless the name cannot be resolved or the server name changed and he did not update SQL appropriately.

    Oops...good catch. Thanks.

  • So you can successfully ping by server name, or you can't? If you can ping by server name now try connecting by name again in ssms.

    I can ping by name. I cannot still connect via ssms using the fqdn (like i used in the ping command)

  • Is the IP address that reponds to the ping the same IP that you use to successfully connect?

    Curious, if you connect to one of these instances by IP name what do you get when you run the following query:

    SELECT @@servername

    One last thing: on an instance that you can connect to by IP what ports/protocols/names does the SQL Error log say it is listening on?

    Joie Andrew
    "Since 1982"

Viewing 14 posts - 1 through 13 (of 13 total)

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