Technitium DNS App for LANCache.NET
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Yip Rui Fung 11252e2690
Merge pull request #26 from virtitnerd/fix/nodata-for-missing-record-type
Return NODATA instead of NXDOMAIN when a cached name has no records of the requested type
2026-11-08 23:05:57 +08:00
.github/workflows Add configuration to dotnet test so it works on Release 2026-04-30 01:02:53 +08:00
.idea Update to latest TDNS and support IDnsAppPreference 2025-04-19 12:13:11 +08:00
DnsServer@0dd592aad2 chore: update Technitium dependency pins 2026-10-23 20:40:52 +08:00
LANCacheApp Merge branch 'main' into fix/nodata-for-missing-record-type 2026-11-08 23:02:49 +08:00
LANCacheApp.Tests Merge branch 'main' into fix/nodata-for-missing-record-type 2026-11-08 23:02:49 +08:00
TechnitiumLibrary@4a5a530ac6 chore: update Technitium dependency pins 2026-10-23 20:40:52 +08:00
.gitignore Add AI generated unit tests for this DnsApp 2026-04-30 00:54:09 +08:00
.gitmodules Initial commit 2023-12-06 00:11:00 +08:00
LANCache-TDNSApp.sln Add solution file 2023-12-06 00:34:48 +08:00
LICENSE Initial commit 2023-12-06 00:02:28 +08:00
mise.toml Add AI generated unit tests for this DnsApp 2026-04-30 00:54:09 +08:00
README.md docs: update badges in README 2026-10-24 07:28:15 +08:00
Taskfile.yml Add AI generated unit tests for this DnsApp 2026-04-30 00:54:09 +08:00

LANCache-TDNSApp

build-dev release GitHub Release Ask DeepWiki

Technitium DNS App for LANCache.NET

This DNS App, will use a specified set of domains to cache. And intercept requests for those domains with configured lancache addresses.
This implements the functionality of Lancache-DNS and is intended to be used with LANCache Monolithic.

Cache targets may be hostnames as well as IP addresses. When a hostname is used, it is resolved internally by Technitium DNS, so the target can be provided by another T-DNS APP record—for example, the Split Horizon or Failover app. This lets those apps select or fail over between cache addresses when resolving the target.

Requirements

  1. Technitium DNS server
  2. LANCache Monolithic instance(s) (Or other compatible implementation.)
  3. The cache server should ideally be accessible using a address in the ULA/RFC1918 IP address range.

Installation

  1. Download the ZIP file from Github Releases
  2. Go to 'Apps' in Technitium DNS
  3. Click the 'Install' button
  4. Specify a name (This is just for your reference)
  5. Select the ZIP file you downloaded
  6. Click the 'Install' button
  7. Done

Updating

  1. Download the ZIP file from Github Releases
  2. Go to 'Apps' in Technitium DNS
  3. Find the installed app in the list
  4. Click the 'Update' button
  5. Select the ZIP file you downloaded
  6. Click the 'Update' button
  7. Done

Configuration

Property Description Default
lanCacheEnabled Enables LANCache domain interception. false
appPreference Priority when multiple DNS Apps overlap; lower values are evaluated first. 50
operatingMode T-DNS App mode in which LANCache handling runs. Valid values: Blocking or Authoritative. Authoritative
enableDebugLogging Enables debug log messages. false
domainsDataUrl URL for the LANCache domains ZIP. It must contain a cache_domains.json file. See cache-domains. https://github.com/uklans/cache-domains/archive/refs/heads/master.zip
domainsDataPathPrefix Path prefix to cache_domains.json inside the ZIP; GitHub archive downloads put the repository contents in a subfolder. cache-domains-master/
domainsUpdatePeriodHours How often to check for updates to the cached domains list, in hours. 24
ignoreClientAddresses Client IPv4/IPv6 addresses, CIDR subnets, or FQDNs to skip. FQDNs are resolved to IPv4/IPv6 addresses at app initialization. Configured cache target addresses are automatically included. Add 0.0.0.0 if internal DNS App lookups should be ignored, since those may use that source address. []
globalCacheAddresses Cache targets used when no cache-type override is configured. Each target may be a hostname, IPv4 address, or IPv6 address. []*
cacheAddresses Per-cache-type target overrides. Cache types come from cache_domains.json. Use {} to use globalCacheAddresses for all cache types. Each target may be a hostname or IP address. {}*
enabledCaches Allowlist of cache types. When non-empty, only listed types are enabled; use [] to disable the allowlist. []
disabledCaches Denylist of cache types. Listed types are disabled; use [] for no exclusions. []
recordTtl TTL, in seconds, used for records returned for cached domains. 3600
legacyUpstreamBehavior For any cached domain with no cache answer, allow normal DNS processing to continue. false
fallbackOnCnameTargetNoAnswer For hostname cache targets, allow normal DNS processing to continue when target resolution does not produce an answer matching the requested record type. When false, retain the CNAME even if no matching target record was resolved. false

* The generated default configuration uses lancache.example.com as a placeholder in globalCacheAddresses, and for the steam and windowsupdates entries in cacheAddresses. Replace these example targets with your cache server(s). When a property is omitted from a supplied configuration, its type default is used (empty lists/maps, false, or the property default shown above).

Default configuration

{
  "lanCacheEnabled": false,
  "appPreference": 50,
  "operatingMode": "Authoritative",
  "enableDebugLogging": false,
  "domainsDataUrl": "https://github.com/uklans/cache-domains/archive/refs/heads/master.zip",
  "domainsDataPathPrefix": "cache-domains-master/",
  "domainsUpdatePeriodHours": 24,
  "ignoreClientAddresses": [],
  "globalCacheAddresses": [
    "lancache.example.com"
  ],
  "cacheAddresses": {
    "steam": [
      "lancache.example.com"
    ],
    "windowsupdates": [
      "lancache.example.com"
    ]
  },
  "enabledCaches": [],
  "disabledCaches": [],
  "recordTtl": 3600,
  "legacyUpstreamBehavior": false,
  "fallbackOnCnameTargetNoAnswer": false
}

Example configuration (All caches enabled)

{
  "lanCacheEnabled": true,
  "enableDebugLogging": false,
  "domainsDataUrl": "https://github.com/uklans/cache-domains/archive/refs/heads/master.zip",
  "domainsDataPathPrefix": "cache-domains-master/",
  "domainsUpdatePeriodHours": 24,
  "ignoreClientAddresses": [],
  "globalCacheAddresses": [
    "lancache.example.home.internal"
  ],
  "cacheAddresses": {},
  "enabledCaches": [],
  "disabledCaches": [],
  "recordTtl": 3600,
  "legacyUpstreamBehavior": false,
  "fallbackOnCnameTargetNoAnswer": false
}

Troubleshooting LANCache issues

Please have a look at https://lancache.net/docs/common-issues

Note: Issues related to lancache-dns are not relevant as this replaces that.

IPv6 Support

While the official lancache-dns does not support IPv6, LANCache-TDNSApp does.

Ensure your lancache-monolithic (Or other caching implementation) is IPv6 enabled and it should just work.

AI Usage Disclosure

AI tooling has been used to help in the maintenance of documentation and code. AI-generated code has been produced under supervision and reviewed appropriately.