Edit hosts file on Windows 7
If you want to redirect ip addresses and/or names instead of using DNS for those specifc lookups, you need to edit your hosts file.
Some reasons for doing this: Your dns server doesn’t know about the host. This can be completely normal for internal networks where you may or may not have DNS. You could have a static IP address that doesn’t resolve to the particular name you would like. In this case you disagree with your DNS server and using the host file, you redirect it to whatever you want. Another reason might be to avoid accessing a specific server altogether. You can redirect the lookup of a valid name in DNS to another ip address, localhost for instance. This works because hosts lookups supersede DNS queries by default. If you run a web server you can host the files that are trying to be accessed to avoid accessing the defaults.
But whatever the reason, you want to edit the hosts file. This goes for just about all versions of windows — the file you are looking for is:
Since this is a system area, normal users will not be able to edit the file. So open it in notepad under “Run as Administrator”
To see this area you may need to enable the show-hidden-files setting. This is one of those bad settings that irritate me, but not nearly as much as hiding file extensions.
Explorer->Tools->Folder Options->Show hidden files, folders,and drives