Windows DNS挂钩 [英] Windows DNS hooks

查看:69
本文介绍了Windows DNS挂钩的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Windows如何解析DNS,以及如何拦截呼叫以注入我自己的域?我需要在应用程序中使用它,而运行我自己的DNS服务器或修改hosts文件不是解决方案.

How does Windows resolve DNS and how can I intercept the calls, in order to inject my own domains? I need this in an application, and running my own DNS server or modifying the hosts file is not a solution.

推荐答案

我不确定您的目的是什么,但是有几种选择. CodeProject 可能会对您有所帮助.它似乎可以满足您的需求.现在,另一种解决方案可能涉及您自己的一些工作,这些工作可能不适合该项目.首先,您需要确定以下功能是您要修改的应用程序中负责DNS查找的命令.下一步基本上是自己实现CodeProject代码,使用

I'm not sure what your purpose is, but there are several options. CodeProject includes something that might help you here. It seems to do what you need to do. Now, the other solution might involve abit of work of your own that might be inappropiate for the project. For one, you need to figure out if the following function is the one responsible for DNS lookups in the applications you want to modify. The next stage is basically implementing the CodeProject code yourself, set up a global hook using Microsoft Detours and in the returning trampoline insert your modifying code.

我仍然不太确定为什么需要这样做,如果您可以提供有关最终目标的更多详细信息,则可能会得到更好的答案.

I'm still not quite sure why you need to do this though, if you would provide more detail on the end goal, you might get better answers.

这篇关于Windows DNS挂钩的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆