开发者

Is there a way to simulate DNS Hijacking for testing purposes?

I'm working on an application that connects to URLs, and it responds differently depending on whether or 开发者_StackOverflow社区not an address resolves in DNS. I need to find a way to simulate DNS Hijacking so that I can test that my application handles it correctly.

Anybody know a way to do that?


Set up a DNS Server on a second pc and use this as your referenced DNS. Then you can shutdown it for sometime or modify the answers to try your handling behavior. If you dont have a second machine you can also set it up in a virtual machine.


Just add the "hijacked" hosts into your hosts file. In Linux, this should be in /etc/hosts; in Windows, %SYSTEMDIR%\drivers\etc\hosts..

The entries are in the format ip.addr.ess.here hostname1 hostname2 (there should already be entries for localhost, so add others to match your taste)

When you're done, remove (or comment out) from the hosts file again.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜