How to DNS spoof on windows

DNS spoofing is when you force your operating system into thinking a domain is pointing to an IP address different then what the rest of the internet see's. This can be useful when you move a site from one server to another but want to test the site before pointing it to the new server.


These instructions assume that your windows installation is located on at c:\Windows.

  • Press Windows key + r to open the run command box.
  • Enter “notepad c:\windows\System32\drivers\etc\hosts” in the text field
  • Press Ctrl+Shift+Enter so that notepad is started with administrator privileges

Notepad should now be open. At the bottom of the file you will need to add a new line. On this new line first enter the IP address followed by a space and then the domain as shown below.

If your testing a website you will probably want to add the www prefix as well

  • Now press Ctrl+S to save your changes and open your web browser to view the site.

Do not forget to remove, or comment out the changes you made to the hosts file when your done! If you forget your workstation will continue to force that domain to the IP address you specified.