mpc: update to 0.35
[feed/packages.git] / utils / cache-domains / README.md
1 # cache-domains
2
3 hotplug script to dynamically configure the local DNS (dnsmasq) to redirect game content servers to a LAN cache. Definitive list dynamically obtained from https://github.com/uklans/cache-domains.
4
5 ## Configuration
6 The configuration file (`/etc/cache-domains.json`) follows the same [syntax as the upsteam file](https://github.com/uklans/cache-domains/blob/master/scripts/config.example.json). The key for each `cache_domains` member matches the name of one of the `.txt` files in the [upstream root directory](https://github.com/uklans/cache-domains/blob/master/), except for the `default` key which matches the all the unreferenced `.txt` files. The value of each `cache_domains` member maps to one of the keys of the `ips` members, Thus mapping a cached domain to a list of IP addresses/LAN cache server.
7
8 ```json
9 {
10 "ips": {
11 "server1": ["10.10.3.10", "10.10.3.11"],
12 "server2": "10.10.3.12",
13 "server3": "10.10.3.13"
14 },
15 "cache_domains": {
16 "default": "server1",
17 "blizzard": "server1",
18 "origin": "server1",
19 "steam": "server2",
20 "wsus": "server3",
21 "xboxlive": "server3"
22 }
23 }
24 ```
25
26 ## Configure/Cleanup
27 `/usr/bin/cache-domains configure` will configure the local DNS (dnsmasq) to redirect the configured cache domains. `/usr/bin/cache-domains cleanup` will cleanup redirection. The hotplug script calls `/usr/bin/cache-domains configure` when the WAN interface is brought up.
28
29 ## Testing
30 After configuring with the above example configuration, running `nslookup lancache.steamcontent.com` would return `10.10.3.12`