How to enable the DNS-cache only when needed

Forums General Guides How to enable the DNS-cache only when needed

Viewing 0 reply threads
  • Author
    Posts
    • #44828
      hackerman1
      Moderator

        How to enable the DNS-cache only when needed

        For security-reasons it´s a good idea to disable the DNS-cache in order to prevent DNS-cache poisoning.
        But what if you have a program fx. a VPN that needs to have the DNS-cache enabled ?
        In the example below I´m using CyberGhost VPN.

        You need two 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 if you are using some other VPN-program then of course you will have to modify those 2 lines,
        by changing the service & path to the program you are using,

        Stop CyberGhost.bat


        SC STOP CGVPNCliService
        SC STOP Dnscache

        Note: you have 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 for both shortcuts: under Properties → Advanced, mark “Run as Administrator”.

    Viewing 0 reply threads
    • You must be logged in to reply to this topic.