SQL Server Troubleshooting: Login is from an untrusted domain and cannot be used with Windows authentication. (Microsoft SQL Server, Error: 18452)

SQL SERVER ERROR:

Cannot connect to MSSQL Login failed. The login is from an untrusted domain and cannot be used with Windows authentication. (Microsoft SQL Server, Error: 18452)

SOLUTION:

  1. Open host file and add entry like 127.0.0.1 localhost. 
  2.  Once It is added we can reconnect to SQL Server as usual.
  3. The location of the host file is C:\Windows\System32\drivers\etc.
  4. You will find the file with the name hosts in it. Open it with Notepad.