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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s