this post was submitted on 21 Jan 2024
1 points (100.0% liked)

WireGuard

3 readers
1 users here now

WireGuard - a fast, modern, secure VPN Tunnel.

founded 1 year ago
MODERATORS
 
This is an automated archive.

The original was posted on /r/wireguard by /u/mhmert on 2024-01-19 18:23:51+00:00.


Hi have two docker configs, both in the same network. One for pihole and one for wireguard.

Is there a way to point the wireguard dns to my pihole without using an IP but using the pihole container's hostname?

version: "3.4"
services:
  wireguard:
    image: lscr.io/linuxserver/wireguard:latest
    container_name: wireguard
    cap_add:
      - NET_ADMIN
      - SYS_MODULE
    environment:
      - PUID=1000
      - PGID=1000
      - SERVERPORT=51820 #optional
      - PEERS=2 #optional
      - LOG_CONFS=true #optional
    volumes:
      - ./configWG:/config
      - /lib/modules:/lib/modules #optional
      - /usr/src:/usr/src
    ports:
      - 51820:51820/udp
    sysctls:
      - net.ipv4.conf.all.src_valid_mark=1
    dns:
      - 172.22.0.2

    networks:
      - pihole_pihole_net

    restart: unless-stopped
networks:
  pihole_pihole_net:
    name: network_pihole
    external: true

docker inspect network_pihole:

"Containers": { "xxxb": { "Name": "wireguard", "EndpointID": "xxxa, "MacAddress": "a:a:a:a:a:a", "IPv4Address": "172.22.0.3/16", "IPv6Address": "" }, "xxxa": { "Name": "pihole", "EndpointID": "xxxb", "MacAddress": "b:b:b:b:b:b", "IPv4Address": "172.22.0.2/16", "IPv6Address": "" } }, "Options": {}, "Labels": { "com.docker.compose.network": "pihole", "com.docker.compose.project": "networks", "com.docker.compose.version": "2.21.0" }

no comments (yet)
sorted by: hot top controversial new old
there doesn't seem to be anything here