In order to reduce the consumed traffic, it is necessary to limit the download of unnecessary content and, if possible, cache traffic.
Step one. Caching DNS queries.')
There are various programs for this purpose. Since I am an opponent of combines, where everything is "all inclusive", the following program is more appealing to me.
Deadwood is an easy (~ 35 kB) local DNS server with a caching function. Officially works in Windows XP and CentOS Linux, other operating systems are in question.
Utanovka is simple. After unarchiving into the necessary folder, it is enough to install the service by running the command line:
Deadwood --installIn order to remove, just run
Deadwood --remove , after stopping the service.
After installation, edit the settings file dwood2rc.txt By running our service with the parameter:
-f filefile will be used as a configuration file
In short, about the parameters used:
upstream_servers - list of DNS servers to which requests will be sent. Here you can specify the DNS server of the provider, or any other, which is nice to us. Let it be =
208.67.222.222, 208.67.220.220 - the service OpenDNS.
There is one interesting feature in this parameter. It is implemented as a dictionary of variables. The initialization string of this dictionary can be seen at the beginning of the configuration file:
upstream_servers = {}Advantages: for any domain, you can specify your server.
Example, if we add this value after the initialization string:
upstream_servers ["google.com."] = "8.8.8.8"everything ending in “google.com” will be requested from the DNS server “8.8.8.8”, and everything else, according to the following line, from OpenDNS!
bind_address - the IP address of our local server. Since, for the time being, we will not use it as a caching server of the home network, we indicate
127.0.0.1recursive_acl - a list of addresses who is allowed to use this DNS server. So far, it will be used as a local server, we will allow only local connections (in the format IP / mask) =
127.0.0.1/8 .
random_seed_file - a file with random content. Deadwood reads only 256 first bytes from there. It is advisable for security that the contents of this file change with each login.
cache_file - the cached information will be stored in this file. The file name can contain only uppercase Latin letters, the characters "-" and "_", and to indicate the subfolder "/", all other characters must be replaced with "_".
Now you can start the service. For Windows 2k and higher command:
net start deadwoodAfter successful launch of the service, a log file will be created in the program folder - dwlog
Also, some keys may be interesting and useful.
chroot_dir - pack from which the service is started;
dns_port - our server will listen to this port;
ip_blacklist - list of undesirable IP addresses;
max_inflights - maximum number of simultaneously served clients (default 8);
maximum_cache_elements - the maximum number of cached items (1024 by default);
To protect against attacks, the port of outgoing requests is constantly changing, the following two parameters will help to configure this feature:
recurse_min_bind_port - the smallest port number from which our server will send requests (by default 15000);
recurse_number_ports - the number of outgoing ports (4096 by default).
Now that our local caching DNS server is running, we can change the network connection settings to use it as a system DNS server.
Further...Step two. Web proxy caching