mirror of
https://github.com/uklans/cache-domains
synced 2024-11-24 20:33:03 +00:00
Add README.md for DNS generation scripts
Also fix up some typos in the main README.md.
This commit is contained in:
parent
74cab757af
commit
3e649ab5d7
2 changed files with 54 additions and 5 deletions
10
README.md
10
README.md
|
@ -11,13 +11,13 @@ You can use this list one of two ways:
|
|||
- Overriding DNS for these hostnames to point to the IP of your cache server.
|
||||
- Use them in Squid with WCCP to redirect content to the right cache server.
|
||||
|
||||
There is a cache_domains.json file to define CDNs and additional meta deta with the following structure
|
||||
There is a cache_domains.json file to define CDNs and additional metadata with the following structure
|
||||
|
||||
- cache_domains: Array of cache_domain object
|
||||
- name: shortname for the cache domain. Should match `^[0-9A-Za-z]$`
|
||||
- description: a longer description to aid others in identifying what this domain does (not all users of this repo will want to enable all caches)
|
||||
- notes: implementation specific notes which may be useful for other users
|
||||
- domain_files: array of files within the repo assosciated to the cdn. Most cdn's only need one file
|
||||
- domain_files: array of files within the repo associated to the cdn. Most CDNs only need one file
|
||||
- Example domain entry for steam
|
||||
```json
|
||||
{
|
||||
|
@ -35,7 +35,7 @@ There is a cache_domains.json file to define CDNs and additional meta deta with
|
|||
|
||||
There is a separate file for each cacheable service. Some notes on formatting:
|
||||
|
||||
- Every line should be a seperate hostname for that service.
|
||||
- Every line should be a separate hostname for that service.
|
||||
- Only one entry is permitted per line.
|
||||
- Wildcards are permitted as per below
|
||||
- Lines starting with a # will be treated as a comment.
|
||||
|
@ -46,10 +46,10 @@ There is a separate file for each cacheable service. Some notes on formatting:
|
|||
|
||||
The wildcard format shall be defined as per the below
|
||||
|
||||
- Wildcards should be represented with an asterix.
|
||||
- Wildcards should be represented with an asterisk.
|
||||
- If a wildcard is used, it should be the first character on the line.
|
||||
- Wildcards are not treated as matching null, e.g. `*.example.com` will match `a.example.com` but will not match `example.com`
|
||||
- Only simple domain wildcards will be accepted eg `*.example.com` not `*ww.example.com`
|
||||
- Only simple domain wildcards will be accepted e.g. `*.example.com` not `*ww.example.com`
|
||||
|
||||
##### Notes for Squid users
|
||||
|
||||
|
|
49
scripts/README.md
Executable file
49
scripts/README.md
Executable file
|
@ -0,0 +1,49 @@
|
|||
# DNS Generation Scripts
|
||||
|
||||
## Introduction
|
||||
|
||||
The respective shell scripts contained within this directory can be utilised to generate application specific compliant
|
||||
configuration which can be utilised with:
|
||||
|
||||
* Dnsmasq
|
||||
* Unbound
|
||||
|
||||
## Usage
|
||||
|
||||
1. Copy `config.example.json` to `config.json`.
|
||||
2. Modify `config.json` to include your Cacheserver's IP(s) and the CDNs you plan to cache.
|
||||
The following example assumes a single shared Cacheserver IP:
|
||||
```json
|
||||
{
|
||||
"ips": {
|
||||
"generic": ["10.10.10.200"]
|
||||
},
|
||||
"cache_domains": {
|
||||
"blizzard": "generic",
|
||||
"epicgames": "generic",
|
||||
"nintendo": "generic",
|
||||
"origin": "generic",
|
||||
"riot": "generic",
|
||||
"sony": "generic",
|
||||
"steam": "generic",
|
||||
"uplay": "generic",
|
||||
"wsus": "generic"
|
||||
}
|
||||
}
|
||||
```
|
||||
3. Run generation script relative to your DNS implementation: `bash create-dnsmasq.sh`.
|
||||
4. Copy files from `output/{dnsmasq,unbound}/*` to the respective locations for Dnsmasq/Unbound.
|
||||
5. Restart Dnsmasq or Unbound.
|
||||
|
||||
### Notes for Dnsmasq users
|
||||
|
||||
**This also applies to users utilising the script alongside Pi-hole.**
|
||||
|
||||
If utilising the `create-dnsmasq.sh` the generation script will create a `lancache.conf` which also loads in the respective `*.hosts` files.
|
||||
|
||||
The `lancache.conf` should be copied into the `/etc/dnsmasq.d/` location but also will need to be modified to point to the respective location of the `*.hosts` files.
|
||||
|
||||
You can copy the `*.hosts` file to any location other than `/etc/dnsmasq.d/` as this location is utilised only for `*.conf` files.
|
||||
|
||||
For example if utilising Pi-hole a user can copy the `*.hosts` files to `/etc/pihole/` and modify the `lancache.conf` with the following command, prior to copying it to `/etc/dnsmasq.d/`:
|
||||
`sed -i 's/dnsmasq.d/pihole/g' output/dnsmasq/lancache.conf`
|
Loading…
Reference in a new issue