lancachenet / lancache-dns

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

Fails to work as a DNS server for the current host #36

Closed M1ke closed 4 years ago

M1ke commented 6 years ago

Issue Description:

Having installed the DNS resolver on a server, other clients on the network using this server and the docker container as their DNS resolver work correctly to resolve DNS.

However trying a command e.g. host google.com 192.168.1.253 or host cs.steampowered.com 192.168.1.253 to direct a DNS resolution at the docker container from the server itself fails. I.e. if the server itself wants to access Steam, it will go via the internet not the cache, however if any separate machines using the DNS want to access the cache it will work.

I appreciate maybe there's some more network config required here, but this would be very useful to have documented, as otherwise one can run the container, test it using host (a really clear way to test DNS on a server) and it seems to fail.

Docker Run Command:

version: '2'

services:

  gamecache-dns:
    image: steamcache/steamcache-dns:latest
    container_name: gamecache-dns
    ports:
      - "53"
    environment:
      - USE_GENERIC_CACHE=false
      # - LANCACHE_IP=genericcache
      - STEAMCACHE_IP=192.168.1.240
      - ORIGINCACHE_IP=192.168.1.241
      - BLIZZARDCACHE_IP=192.168.1.242
      - UPLAYCACHE_IP=192.168.1.243
      # - FRONTIERCACHE_IP=frontiercache
      # - RIOTCACHE_IP=riotcache
      - WINDOWSCACHE_IP=192.168.1.246
      - DISABLE_STEAM=false
      - DISABLE_ORIGIN=false
      - DISABLE_BLIZZARD=false
      - DISABLE_UPLAY=false
      - DISABLE_FRONTIER=true
      - DISABLE_RIOT=true
      - DISABLE_WINDOWS=false
      - UPSTREAM_DNS=8.8.8.8
    networks:
      gamecache_vlan:
        ipv4_address: 192.168.1.253
    restart: unless-stopped
    volumes:
      - /srv/quickload/docker-volumes/gamecache/dns:/data
      - /srv/quickload/docker-volumes/gamecache/dns:/tmp
      - /srv/quickload/docker-volumes/gamecache/dns:/var/logs
matthewh86 commented 6 years ago

Could be this issue https://stackoverflow.com/questions/44048915/unable-to-access-docker-containers-from-host-over-macvlan-network

Would it work if you declared a private docker network with two steamcache-dns running?

E.g.

version: '2'

services:

  gamecache-dns-ext:
    image: steamcache/steamcache-dns:latest
    container_name: gamecache-dns
    ports:
      - "53"
    environment:
      - USE_GENERIC_CACHE=true
      - LANCACHE_IP=192.168.1.240
      - UPSTREAM_DNS=8.8.8.8
    networks:
      external_vlan:
        ipv4_address: 192.168.1.253
    restart: unless-stopped

  gamecache-dns-int:
    image: steamcache/steamcache-dns:latest
    container_name: gamecache-dns
    ports:
      - "53:53"
    environment:
      - USE_GENERIC_CACHE=true
      - LANCACHE_IP=172.18.0.240
      - UPSTREAM_DNS=8.8.8.8
    networks:
      - internal_lan
    restart: unless-stopped

  steamcache:
    image: steamcache/generic:latest
    container_name: steamcache
    ports:
      - "80"
    environment:
      - CACHE_MEM_SIZE=1024m
      - CACHE_DISK_SIZE=1024g
    networks:
      external_vlan:
        ipv4_address: 192.168.1.240
      internal_vlan:
        ipv4_address: 172.18.0.240
    restart: unless-stopped

networks:
  external_vlan:
    driver: macvlan
    driver_opts:
      parent: eth0
    ipam:
      config:
        - subnet: 192.168.1.0/24
  internal_lan:
    ipam:
      config:
        - subnet: 172.18.0.0/16

I haven't tested this with steamcache-dns and steamcache, but should work since internal_lan has pingable IPs.

VibroAxe commented 5 years ago

@matthewh86 did you solve this? I've not seen this anywhere else which implies it's an oddity of how you've configured docker/your network

unspec commented 4 years ago

Closing due to inactivity, feel free to reopen if there is still something you think we can help with.