none
Can Connect SQL instance by IP but not host name - 2019 std sql RRS feed

  • Question

  • hi , 

    i have installed sql server 2019 standard edition on Linux - ubuntu server.

    i am able to connect the instance through the server IP from my laptop SSMS, but where as when i try to connect the same through hostname its not connecting . 

    Can you please tell me to resolve this . 

    i have ensured that all the sql service are up and run including browser

    thank you 


    hemadri



    • Edited by Hemadribabu Tuesday, May 26, 2020 4:34 PM
    • Moved by Tom Phillips Wednesday, May 27, 2020 4:30 PM Replication setup question
    Monday, May 25, 2020 10:56 AM

All replies

  • Most likely, host name resolution is not working as expected from your laptop. Run NSLOOKUP to verify the Linux host name is properly registered in the DNS server you are using:

    NSLOOKUP your-linux-hostname



    Dan Guzman, Data Platform MVP, http://www.dbdelta.com

    • Proposed as answer by Lily Lii Wednesday, May 27, 2020 7:33 AM
    Monday, May 25, 2020 11:10 AM
  • Hi hemadri,

    You could type nslookup <ip address>, NSLOOKUP actually asks the DNS server for the IP address of the hostname. Ping will use the local DNS Resolver Cache, which may be incorrect until you flush.

    Best Regards,

    Lily


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com

    Tuesday, May 26, 2020 3:17 AM
  • If you Laptop is running on Windows OS, please make an entry on host file in your system with SQL Server name and IP address. You can open the file on Notepad and make the entry and save the file. This may fix the problem.

    C:\Windows\system32\drivers\etc\hosts

    Tuesday, May 26, 2020 3:35 AM
  • Hi hemadri,

    Do the answers above help you? Please feel free to let us know if you have any other question.

    If you have solved your issue, please kindly mark helpful replies as answers. By doing so, it will benefit all community members who are having this similar issue.

    Best Regards,

    Lily


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com

    Wednesday, May 27, 2020 7:34 AM
  • That message is not coming from attempting to connect, but from trying to setup replication distribution.  To setup a distributor you must use the same DNS name.  The best solution to this problem is to configure the distributor from the actual server, instead of remotely.

    See:

    https://docs.microsoft.com/en-us/sql/linux/sql-server-linux-replication-tutorial-tsql?view=sql-server-ver15


    Wednesday, May 27, 2020 4:27 PM