Differences

This shows you the differences between two versions of the page.

Link to this comparison view

how-to-dns-spoof-on-linux [2019-04-11 11:22:27] (current)
shaun.reitan created
Line 1: Line 1:
 +====== How to DNS spoof on Linux ======
  
 +DNS spoofing is when you force your operating system into thinking a domain is pointing to an IP address different from what the rest of the internet see'​s. ​ This can be useful when you move a site from one server to another and want to test the site before pointing the domain to the new server.
 +
 +===== Instructions =====
 +
 +These instructions should work for the majority of Linux distributions available today. You must have super user access (root) to make the necessary changes. These instructions show how to make these changes via the command line.
 +
 +  * Using your favorite text editor open "/​etc/​hosts"​
 +
 +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.
 +
 +<code console>
 +10.0.0.1 domain.com
 +</​code>​
 +
 +If your testing a website you will probably want to add the www prefix as well
 +<code console>
 +10.0.0.1 domain.com www.domain.com
 +</​code>​
 +
 +  * Now you can save and quit.
 +
 +Do not forget to remove, or comment out the changes you made to this file when your done! If you forget your system will continue to force the domain to the IP address you specified.