cache-domains/scripts
Amir Zarrinkafsh 098c1e9c54
feat: add lefthook, megalinter and update editorconfig (#270)
This change adds [LeftHook](https://lefthook.dev/) as a GitHub hook management tool alongside [MegaLinter](https://megalinter.io/) to lint all relevant files within the repository.

For users that don't end up installing LeftHook for pre-commit hooks, megalinter picks up the necessary formatting changes and reports them.

* feat: add lefthook, megalinter and update editorconfig
* fix: lint commit ordering
* refactor: adjust megalinter reporters
* refactor: adjust description for cache domains
* refactor: single - for passing options
* refactor: add repo-specific fmt in megalinter pre-commands too
2025-07-24 10:59:52 +10:00
..
config.example.json feat: add lefthook, megalinter and update editorconfig (#270) 2025-07-24 10:59:52 +10:00
create-adguardhome.sh feat: add lefthook, megalinter and update editorconfig (#270) 2025-07-24 10:59:52 +10:00
create-dnsmasq.sh feat: add lefthook, megalinter and update editorconfig (#270) 2025-07-24 10:59:52 +10:00
create-rpz.sh feat: add lefthook, megalinter and update editorconfig (#270) 2025-07-24 10:59:52 +10:00
create-squid.sh feat: add lefthook, megalinter and update editorconfig (#270) 2025-07-24 10:59:52 +10:00
create-unbound.sh feat: add lefthook, megalinter and update editorconfig (#270) 2025-07-24 10:59:52 +10:00
README.md Update scripts and add combined_output flag (#251) 2024-10-25 09:13:50 +01:00

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:

  • AdGuard Home
  • BIND9
  • Dnsmasq/Pi-hole
  • Squid
  • 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:

{
    "combined_output": false,
    "ips": {
        "monolithic":   ["10.10.10.200"]
    },
    "cache_domains": {
        "blizzard":     "monolithic",
        "epicgames":    "monolithic",
        "nintendo":     "monolithic",
        "origin":       "monolithic",
        "riot":         "monolithic",
        "sony":         "monolithic",
        "steam":        "monolithic",
        "uplay":        "monolithic",
        "wsus":         "monolithic"
    }
}
  1. Run generation script relative to your DNS implementation: bash create-dnsmasq.sh.
  2. If combined_output is set to true this will result in a single output file: lancache.conf with all your enabled services (applies to Adguard Home, Dnsmasq or Unbound).
  3. Copy files from output/{adguardhome,dnsmasq,rpz,squid,unbound}/* to the respective locations for Dnsmasq/Unbound.
  4. Restart the appropriate service.

Notes for Dnsmasq users

This also applies to users utilising the script alongside Pi-hole.

Multi-IP Lancache setups are only supported with Dnsmasq or Pi-hole versions >= 2.86 or 2021.09 respectively.

Notes for AdGuard Home users

  1. Utilising "combined_output": true is more convenient.
  2. Once you have run the script and uploaded the file to the appropriate location, you should navigate to Adguard Home -> Filters -> DNS blocklists -> Add blocklist -> Add a custom list.