Local Computer DNS Testing

If you need to set up a test environment for a local install, requiring actual DNS resolution to mimic a production setting, you can make one quick change to a local file.

The file is “hosts” located in:

C:\Windows\System32\drivers\etc\

Because of Windows permissions, the best way to approach this is to copy the file to an external folder, or to the desktop, edit and then copy it back to the original location.

It explains what to do in the file but basically all you need to do is create a new line at the bottom of the file, outside of the commented text, type in the IP address and the DNS name for the mapping, separated by at least one space.  You can type in as many as you want, just start a new line and continue.

Example:

192.168.1.50  smtpserver.com

When finished, comment out (#) or delete the entries.  If you have any further DNS issues, you can clear local cache.

Ipconfig /flushdns