lancachenet / monolithic

A monolithic lancache service capable of caching all CDNs in a single instance
https://hub.docker.com/r/lancachenet/monolithic
Other
726 stars 73 forks source link

How to set lancache with windows DNS Server #123

Closed yangcaixing closed 3 years ago

yangcaixing commented 3 years ago

Describe the issue you are having

Our client DNS server is Windows DNS server via DHCP(must be this), and set up lancache server on ubuntu, on windows server add steam(steampowered.com)condition forward item to lancache server, but still not work, how can I set up with the DNS of lacache server. thanks very much.

How are you running the container(s)

git clone https://github.com/lancachenet/docker-compose lancache cd lancache nano .env docker-compose up -d

version: '2'
services:
  dns:
    image: lancachenet/lancache-dns:latest
    env_file: .env
#    restart: unless-stopped
    ports:
      - ${DNS_BIND_IP}:53:53/udp
      - ${DNS_BIND_IP}:53:53/tcp

## HTTPS requests are now handled in monolithic directly
## you could choose to return to sniproxy if desired
#
#  sniproxy:
#    image: lancachenet/sniproxy:latest
#    env_file: .env
#    restart: unless-stopped
#    ports:
#      - 443:443/tcp

  monolithic:
    image: lancachenet/monolithic:latest
    env_file: .env
#    restart: unless-stopped
    ports:
      - 80:80/tcp
      - 443:443/tcp
    volumes:
      - ${CACHE_ROOT}/cache:/data/cache
      - ${CACHE_ROOT}/logs:/data/logs

## See the "Settings" section in README.md for more details

## Set this to true if you're using a load balancer, or set it to false if you're using seperate IPs for each service.
## If you're using monolithic (the default), leave this set to true
USE_GENERIC_CACHE=true

## IP addresses that the lancache monolithic instance is reachable on
## Specify one or more IPs, space separated - these will be used when resolving DNS hostnames through lancachenet-dns. Multiple IPs can improve cache priming performance for some services (e.g. Steam)
## Note: This setting only affects DNS, monolithic and sniproxy will still bind to all IPs by default
LANCACHE_IP=172.20.90.247

## IP address on the host that the DNS server should bind to
DNS_BIND_IP=172.20.90.247

## DNS Resolution for forwarded DNS lookups
UPSTREAM_DNS=8.8.8.8

## Storage path for the cached data
## Note that by default, this will be a folder relative to the docker-compose.yml file
CACHE_ROOT=./lancache

## Change this to customise the size of the disk cache (default 1000000m)
## If you have more storage, you'll likely want to increase this
## The cache server will prune content on a least-recently-used basis if it
## starts approaching this limit.
## Set this to a little bit less than your actual available space 
CACHE_DISK_SIZE=1000000m

## Change this to customise the size of the nginx cache manager (default 500m)
## DO NOT CHANGE THIS LIGHTLY. The defaults are enough to address 8TB of cache storage.  Increasing
## this value will cause performance problems, and may cause the cache to fail to start entirely.
CACHE_MEM_SIZE=500m

## Change this to limit the maximum age of cached content (default 3650d)
CACHE_MAX_AGE=3650d

### DNS Configuration
Add DNS Forwarders to lancache server in Windows Server DNS .

### Output of container(s)

[steam] 172.20.60.52 / - - - [16/Dec/2020:07:59:03 +0000] "GET /depot/380603/chunk/5e233157ee781ae3dc1436589fab0d239ccc75ff HTTP/1.1" 502 182 "-" "Valve/Steam HTTP Client 1.0" "MISS" "cdn.mileweb.cs.steampowered.com.8686c.com" "-"
[steam] 172.20.60.52 / - - - [16/Dec/2020:08:05:11 +0000] "GET /depot/380603/chunk/f2a6d543b2802f77a509f678f05c383cf637f08c HTTP/1.1" 502 182 "-" "Valve/Steam HTTP Client 1.0" "MISS" "dl.steam.ksyna.com" "-"
[steam] 172.20.60.52 / - - - [16/Dec/2020:08:05:11 +0000] "GET /depot/380603/chunk/17efd79e0742864b95b5a53bcef750767979bb32 HTTP/1.1" 502 182 "-" "Valve/Steam HTTP Client 1.0" "MISS" "dl.steam.ksyna.com" "-"
[steam] 172.20.60.52 / - - - [16/Dec/2020:08:05:11 +0000] "GET /depot/380603/chunk/549ad83cfa524058c45991e75b2f6221d0bda4fc HTTP/1.1" 502 182 "-" "Valve/Steam HTTP Client 1.0" "MISS" "dl.steam.ksyna.com" "-"
[steam] 172.20.60.52 / - - - [16/Dec/2020:08:05:42 +0000] "GET /depot/380603/chunk/f2a6d543b2802f77a509f678f05c383cf637f08c HTTP/1.1" 502 182 "-" "Valve/Steam HTTP Client 1.0" "MISS" "st.dl.pinyuncloud.com" "-"
VibroAxe commented 3 years ago

From the logs you have provided, this appears to be working. I can see 5 requests going into the cache for 5 different files. The MISS tag is informing you that the particular file is not yet in the cache, secondary downloads of that file should then come up with HIT

The [steam] tag shows that lancache has correctly identified this as steam traffic, irrelevant of the provided hostname

If you DNS wasn't working you wouldn't see any of this