Question : An application to capture DNS query on DNS Client and edit?

Hello Experts,
 
My application has the host server name [say hostname.host.com] in its configuration.

I assume that during startup, this application will try to resolve address for hostname.host.com. To resolve this, the DNS Query is submitted to DNS client and then by using the DNS Server IP stored in TCP/IP properties, this Query is fetched to DNS Server. With the response from DNS Server, application will have a pipe established to correct IP for hostname.host.com and thus application would be able to communicate data on the same pipe.

I want to write a user application say Appli_dns.exe This service or app shall be able to capture and edit specific DNS queries.  


Use case 1: PC in live network i.e. connectivity available

If the client itself attempts to resolve the query locally then Appli_dns.exe shall parse the local query.
1. If query is for hostname.host.com then app / service shall redirect that query to another IP.
2. If query is not for hostname.host.com then it shall be passed to DNS Server


Use case 2: PC Internet connectivity unavailable
In the case where there is no internet connectivity would an application attempt to resolved domain name by sending a query to the DNS client?  

A. If yes, what would be the response this query and how can that be hijacked?

B. If not, then how does the application know that there is no connectivity?

In summary I want to have control over IP resolution and I want to redirect all queries which are for hostname.host.com to another IP rather than contacting DNS servers to resolve the same.  

How this can be achieved for NT based systems? I dont have complete knowledge about Controlling DNS clients, but if anyone provides me any pointers to relevant solution/documentation, I would be grateful.  

If these queries are solved then I have another queries in line for same subjects.

Looking forward for positive solutions

Regards,

Yogi

Answer : An application to capture DNS query on DNS Client and edit?

netsh interface ip set dns "Local Area Connection" static 192.168.0.200

http://www.petri.co.il/configure_tcp_ip_from_cmd.htm
Random Solutions  
 
programming4us programming4us