- C# 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
Return NODATA instead of NXDOMAIN when a cached name has no records of the requested type |
||
| .github/workflows | ||
| .idea | ||
| DnsServer@0dd592aad2 | ||
| LANCacheApp | ||
| LANCacheApp.Tests | ||
| TechnitiumLibrary@4a5a530ac6 | ||
| .gitignore | ||
| .gitmodules | ||
| LANCache-TDNSApp.sln | ||
| LICENSE | ||
| mise.toml | ||
| README.md | ||
| Taskfile.yml | ||
LANCache-TDNSApp
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
- Technitium DNS server
- LANCache Monolithic instance(s) (Or other compatible implementation.)
- The cache server should ideally be accessible using a address in the ULA/RFC1918 IP address range.
Installation
- Download the ZIP file from Github Releases
- Go to 'Apps' in Technitium DNS
- Click the 'Install' button
- Specify a name (This is just for your reference)
- Select the ZIP file you downloaded
- Click the 'Install' button
- Done
Updating
- Download the ZIP file from Github Releases
- Go to 'Apps' in Technitium DNS
- Find the installed app in the list
- Click the 'Update' button
- Select the ZIP file you downloaded
- Click the 'Update' button
- 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.