› Forums › General › General Discussion › Windows Security › Activate and disable the DNS-cache with a bat-file
- This topic has 0 replies, 1 voice, and was last updated 10 years, 2 months ago by hackerman1.
- AuthorPosts
-
- 15th February 2014 at 15:32 #44765
Hi !
I´m using a HOSTS-file from http://winhelp2002.mvps.org/hosts.htm
Following their recommendations i have disabled the DNS-cache in order to prevent DNS-cache poisoning.A few days ago when i was checking some settings in “Services” i noticed that the DNS-cache was enabled !?
I tried to disable it, which was denied because: “other services depends on it”.
I found out that it was a process from CyberGhost VPN which i installed two months ago that needed the DNS-cache running.Mystery solved.
But, I don´t want to have the DNS-cache active, except when needed by CyberGhost, so how do I solve that ?Here is the solution: 2 bat-files, the first starts the CyberGhost-service & the DNS-cache,
the second stops them.Start CyberGhost.bat
SC START Dnscache
SC START CGVPNCliService
START "CYBERGOST" "E:PROGRAM FILESCyberGhost 5CyberGhost.lnk"
Note: the 2nd line is to the service that CyberGhost uses.
the 3rd line is a shortcut to the “main” program (GUI) of CyberGhost,
so of course you will have to modify those 2 lines if you are using some other VPN-program,
by changing the service & path to the program you are using.Stop CyberGhost.bat
SC STOP CGVPNCliService
SC STOP DnscacheAnd you need to run those 2 bat-files elevated (as ADMIN).
If you set the CGVPNCliService to start automatically then you can run the start-file without elevation.
But if you have used the stop-file and then wants to run the start-file again,
then it needs elevation because CGVPNCliService needs ADMIN-privileges.Put the bat-files in in your program-folder, create 2 shortcuts on your desktop.
Then on both shortcuts under Properties → Advanced, mark “Run as Administrator”.
- AuthorPosts
- You must be logged in to reply to this topic.