lancachenet / lancache-dns

DNS Docker service for a lancache.

Home Page:https://hub.docker.com/r/lancachenet/lancache-dns/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DNS not resolving steamcontent.com correctly

codejnki opened this issue · comments

Describe the issue you are having

From inside the DNS container, the correct internal private IP is returned for DNS lookups. Outside of the container it is returning public IP's.

Lancache is running on an Ubuntu 20 server at IP 192.180.190.95.

From any machine on my nework

dig @192.168.190.95 steam.cache.lancache.net returns

;; QUESTION SECTION:
;steam.cache.lancache.net.      IN      A

;; ANSWER SECTION:
steam.cache.lancache.net. 600   IN      A       192.168.190.95

;; AUTHORITY SECTION:
cache.lancache.net.     600     IN      NS      localhost.

This is expected.

dig @192.168.190.95 lancache.steamcontent.com returns

;; QUESTION SECTION:
;lancache.steamcontent.com.     IN      A

;; ANSWER SECTION:
lancache.steamcontent.com. 0    IN      CNAME   origin-tier2.steampipe.steamcontent.com.
origin-tier2.steampipe.steamcontent.com. 0 IN CNAME steampipe-origin-tier2.steamcontent.com.
steampipe-origin-tier2.steamcontent.com. 0 IN A 205.196.6.174
steampipe-origin-tier2.steamcontent.com. 0 IN A 162.254.197.9
steampipe-origin-tier2.steamcontent.com. 0 IN A 162.254.197.25
steampipe-origin-tier2.steamcontent.com. 0 IN A 205.196.6.144

This is unexpected.

To take steps just a little further, if I docker exec -it lancache_dns_1 /bin/bash and then run dig @127.0.0.1 lancache.steamcontent.com it returns:

;; QUESTION SECTION:
;lancache.steamcontent.com.     IN      A

;; ANSWER SECTION:
lancache.steamcontent.com. 5    IN      CNAME   steam.cache.lancache.net.
steam.cache.lancache.net. 600   IN      A       192.168.190.95

;; AUTHORITY SECTION:
cache.lancache.net.     600     IN      NS      localhost.

Which is the answer I am expecting.

I am trying to figure out why the dns is returning the public DNS resolution instead of the private dns resolution when queried from outside of the container, but from inside the container it returns the correct answer.

How are you running the container(s)

docker-compose.yaml

version: '2'
x-restart-policy: &restart-policy "unless-stopped"
services:
  dns:
    image: lancachenet/lancache-dns:latest
    env_file: .env
    restart: *restart-policy
    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: *restart-policy
#    ports:
#      - 443:443/tcp

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

.env

## 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=192.168.190.95

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

## 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=/mnt/cache/lancache

## Change this to customise the size of the disk cache (default 2000000m)
## 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=3000000m

## Change this to allow sufficient index memory for the nginx cache manager (default 500m)
## We recommend 250m of index memory per 1TB of CACHE_DISK_SIZE 
CACHE_INDEX_SIZE=750m

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

## Set the timezone for the docker containers, useful for correct timestamps on logs (default Europe/London)
## Formatted as tz database names. Example: Europe/Oslo or America/Los_Angeles
TZ=America/Detroit

DNS Configuration

The DHCP configuration in my Firewalla is configured to hand out 192.168.190.95 as the only name server.

Output of container(s)

Let me know if there is any specific output you are interested in.

Turns out my Firewalla router was hijacking all DNS lookups on the network with their "DNS Booster" feature. I turned that off and the cache started working as expected.