This activity is ungraded.
Remember: Be sure to watch these Demo videos from this unit before trying this activity. Watching me do it first will help you understand each of the steps.
The hosts File and the DNS Resolver Cache DemoUsing the hosts File to Redirect Traffic to Malicious Servers DemoUsing the hosts File for a DoS Attack DemoGetting help: If you have trouble with these activities, please ask questions in the “Troubleshooting” forum in General Class Discussions.
System: These instructions are for Windows systems (any version).
On Mac and Linux systems, the hosts file is in the /etc directory, so you’ll need to edit /etc/hosts. Instructions on clearing your DNS Resolver Cache on Mac and Linux systems.Time: This activity should take you 10 to 20 minutes to complete.
Note: Hit Enter after each command.
Modify the hosts file
Open up Notepad as an Administrator by clicking on Start > All Programs > Accessories. Right-click on Notepad and select Run as Administrator.Click File > Open, and browse to c:\windows\system32\drivers\etc.Change the dropdown at the bottom from Text Documents (*.txt) to All Files (*.*).You should see hosts.Double-click on hosts to open it.In the file, add 129.21.1.40 www.jonathanscottweissman.edu.Save the file by hitting Ctrl+s.Open up a Windows Command Line Interface.Enter ipconfig /flushdns.This will flush the host’s DNS resolver cache.Enter ipconfig /displaydns.The output shows us the host DNS resolver cache. The entry in the hosts file has been re-added to the host DNS resolver cache.Open up a browser and enter www.jonathanscottweissman.edu.You should see the RIT website.Binding a web address to the loopback address
In the hosts file open in Notepad, add this entry underneath the previous one: 127.0.0.1 www.edx.org.Remember, 127.0.0.1 is the loopback address of your computer.Open up a browser, and try to go to www.edx.org.You’ll see an error message because this website doesn’t exist on your machine.Back in Notepad, remove the entries you made in your hosts file.Resave the hosts file.You’ll continue to work in the hosts file in the next activity.
After you've finished, answer the Check Your Work questions.
转载于:https://www.cnblogs.com/sec875/articles/10028828.html
相关资源:JAVA上百实例源码以及开源项目