lancachenet / lancache-dns

DNS Docker service for a lancache.
https://hub.docker.com/r/lancachenet/lancache-dns/
MIT License
280 stars 73 forks source link

DNS doesn't seem to be working #124

Closed rossengeorgiev closed 2 years ago

rossengeorgiev commented 2 years ago

Describe the issue you are having

I simply followed the quickstart guide and added my server IP. The response for steamcontent domains appears unchanged.

image

Output of container(s)

Executing hook /hooks/entrypoint-pre.d/00_asciilogo.sh
  _                  _____           _                       _
 | |                / ____|         | |                     | |
 | |     __ _ _ __ | |     __ _  ___| |__   ___   _ __   ___| |_
 | |    / _` | '_ \| |    / _` |/ __| '_ \ / _ \ | '_ \ / _ \ __|
 | |___| (_| | | | | |___| (_| | (__| | | |  __/_| | | |  __/ |_
 |______\__,_|_| |_|\_____\__,_|\___|_| |_|\___(_)_| |_|\___|\__|

Executing hook /hooks/entrypoint-pre.d/10_generate_config.sh
configuring /etc/resolv.conf to stop from looping to ourself

Bootstrapping Lancache-DNS from https://github.com/uklans/cache-domains.git
From https://github.com/uklans/cache-domains
   50e5d28..0cf9233  master     -> origin/master
HEAD is now at 0cf9233 Update for City of Heroes (#176)

----------------------------------------------------------------------
Using Generic Server: 139.59.176.101
Make sure you are using a monolithic cache or load balancer at 139.59.176.101
----------------------------------------------------------------------

Processing service: arenanet
Enabling service with ip(s): 139.59.176.101
Processing service: blizzard
Enabling service with ip(s): 139.59.176.101
Processing service: bsg
Enabling service with ip(s): 139.59.176.101
Processing service: cityofheroes
Enabling service with ip(s): 139.59.176.101
Processing service: daybreak
Enabling service with ip(s): 139.59.176.101
Processing service: epicgames
Enabling service with ip(s): 139.59.176.101
Processing service: frontier
Enabling service with ip(s): 139.59.176.101
Processing service: hirez
Enabling service with ip(s): 139.59.176.101
Processing service: nexusmods
Enabling service with ip(s): 139.59.176.101
Processing service: neverwinter
Enabling service with ip(s): 139.59.176.101
Processing service: nintendo
Enabling service with ip(s): 139.59.176.101
Processing service: origin
Enabling service with ip(s): 139.59.176.101
Processing service: pathofexile
Enabling service with ip(s): 139.59.176.101
Processing service: renegadex
Enabling service with ip(s): 139.59.176.101
Processing service: riot
Enabling service with ip(s): 139.59.176.101
Processing service: rockstar
Enabling service with ip(s): 139.59.176.101
Processing service: sony
Enabling service with ip(s): 139.59.176.101
Processing service: square
Enabling service with ip(s): 139.59.176.101
Processing service: steam
Enabling service with ip(s): 139.59.176.101
Processing service: uplay
Enabling service with ip(s): 139.59.176.101
Processing service: teso
Enabling service with ip(s): 139.59.176.101
Processing service: warframe
Enabling service with ip(s): 139.59.176.101
Processing service: wargaming
Enabling service with ip(s): 139.59.176.101
Processing service: wsus
Enabling service with ip(s): 139.59.176.101
Processing service: xboxlive
Enabling service with ip(s): 139.59.176.101

 ---

finished bootstrapping.
Executing hook /hooks/supervisord-pre.d/10_config_check.sh
checking Bind9 config
MathewBurnett commented 2 years ago

Perform your nslookup from another machine, it is quite common for the local host not to route the dns through the container by default.

rossengeorgiev commented 2 years ago

I tried with public ip, and with 10.0.0.0/8, both didn't work as seen below:

root@steamctl ~/lancache $ cat .env
USE_GENERIC_CACHE=true
LANCACHE_IP=10.131.0.2 #139.59.176.101
DNS_BIND_IP=10.131.0.2 #139.59.176.101
UPSTREAM_DNS=8.8.8.8
CACHE_ROOT=./lancache
CACHE_DISK_SIZE=10000m
CACHE_MEM_SIZE=500m
CACHE_MAX_AGE=3650d
TZ=Europe/London

image

Jumped inside the dns container, and bind seems to work fine:

root@steamctl ~/lancache $ docker exec -it lancache_dns_1 /bin/bash
root@c275279440da:/scripts# host lancache.steamcontent.com 127.0.0.1
Using domain server:
Name: 127.0.0.1
Address: 127.0.0.1#53
Aliases:

lancache.steamcontent.com is an alias for steam.cache.lancache.net.
steam.cache.lancache.net has address 10.131.0.2

Checked the logs after doing queries from the outside:

root@steamctl ~/lancache $ docker exec -it lancache_dns_1 /bin/bash
root@360a94fd06fc:/scripts# cd /var/log/named/
root@360a94fd06fc:/var/log/named# cat queries.log
01-Oct-2021 21:41:32.507 client @0x7f06e80c7080 10.131.0.2#35969 (lancache.steamcontent.com): query: lancache.steamcontent.com IN A + (172.20.0.2)
01-Oct-2021 21:41:32.538 client @0x7f06e8498650 10.131.0.2#40673 (steampipe-origin-tier2.steamcontent.com): query: steampipe-origin-tier2.steamcontent.com IN AAAA + (172.20.0.2)
01-Oct-2021 21:41:32.548 client @0x7f06e80c7080 10.131.0.2#59800 (steampipe-origin-tier2.steamcontent.com): query: steampipe-origin-tier2.steamcontent.com IN MX + (172.20.0.2)
01-Oct-2021 21:41:46.466 client @0x7f06e8498650 10.131.0.2#47268 (lancache.steamcontent.com): query: lancache.steamcontent.com IN A +E(0)K (172.20.0.2)
01-Oct-2021 21:43:03.607 client @0x7f06e8498650 10.131.0.2#51146 (lmao.steamcontent.com): query: lmao.steamcontent.com IN A + (172.20.0.2)

You can see queries are hitting the server, but it is doing recursive resolution instead.

If I use the docker bridge IP it works fine:

root@steamctl ~ $ host landcache.steamcontent.com 172.20.0.2
Using domain server:
Name: 172.20.0.2
Address: 172.20.0.2#53
Aliases:

landcache.steamcontent.com is an alias for steam.cache.lancache.net.
steam.cache.lancache.net has address 10.131.0.2

Looking through the bind configs, nothings stands out.

MathewBurnett commented 2 years ago

this is the expected behaviour if you use another machine to do nslookup against your 10.131.0.2 you will find it works.

stale[bot] commented 2 years ago

This issue has been automatically marked as inactive because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.