2

So I found this question and believe this is related. SQL Server Management studio slow connection or timeout when using Windows Authentication

If I extend my timeout to 30 seconds I get SSMS connected but everything is terribly slow! The application is extremely slow/timing out when debugging.

They mention adding an entry to the hosts file to bypass DNS lookup. This is a local dev db running on my machine. What would I add to the hosts file to eliminate these DNS issues??? Servername = "ROG-DREAM-MACHI\SQLDEV".

I'm a db noob. Plz help. :(

Hardycore
  • 123
  • 1
  • 4
  • Should also note, that I'm working on a different network right now. I never had these issues at home or in office. Nothing else has changed. – Hardycore Jul 04 '17 at 19:43
  • Are you connecting as a local user or domain user? – Alex Jul 05 '17 at 03:36
  • Local. This is my personal laptop. Not added to any domains. – Hardycore Jul 05 '17 at 14:19
  • Another note. Once connected, the application I'm debugging seems to work fine. As long as I've set the timeout to 30 it'll connect (takes longer than it should) but once connected it runs as it should. – Hardycore Jul 05 '17 at 14:25
  • Small trick: Open Internet Explorer Go to Tools -> Internet option Open the "Advanced" tab Uncheck "Check for server certificate revocation (requires restart)" This trick is only effective if the computer where your SQL Server Management Studio is installed is NOT connected to Internet. – CR241 Jul 05 '17 at 16:42
  • If above one is not working, try this: In Tools - Options, go to the Environment - General section and for the At Startup option, select Open empty environment. See if that improves anything. – CR241 Jul 05 '17 at 16:43
  • Thanks for the suggestions @CR241 but unfortunately they didn't seem to help. I'm pretty sure it's just taking a long time to authenticate with the db server. – Hardycore Jul 05 '17 at 20:36
  • which one are you using, Windows/SQL authentication? are you getting any timeout error? – CR241 Jul 05 '17 at 20:39
  • Using windows auth. Timeout error is as follows unless I up timeout time to 30. "Cannot connect to ROG-DREAM-MACHI\SQLDEV. Connection Timeout Expired. The timeout period elapsed while attempting to consume the pre-login handshake acknowledgement. This could be because the pre-login handshake failed or the server was unable to respond back in time. The duration spent while attempting to connect to this server was - [Pre-Login] initialization=15647; handshake=7924;" – Hardycore Jul 05 '17 at 22:07
  • @Hardycore did you follow the advice in the related question's answer? And what happened? – ypercubeᵀᴹ Jul 06 '17 at 08:36
  • I wasn't sure what to put in the hosts file because it was a local db. Thankfully posted answer fixed this!!!! :D – Hardycore Jul 06 '17 at 15:20

1 Answers1

5

Your DNS entry in the C:\Windows\System32\drivers\etc\hosts file will be:

ROG-DREAM-MACHI   127.0.0.1

You'll need to use Notepad with administrative rights, to be able to make any changes to that file.

(However, I'm voting to close this question as a duplicate of the one you posted.)

Randolph West
  • 3,683
  • 11
  • 26