title: Wireguard can't resolve local DNS on Docker
body: <p>I have a docker running with multiple container including dnsmasq and wireguard server.</p>
  <p>Docker-compose:</p>
  <pre><code>version: &quot;2.1&quot;
  services:
    wireguard:
      image: ghcr.io/linuxserver/wireguard
      container_name: wireguard
      cap_add:
        - NET_ADMIN
        - SYS_MODULE
      environment:
        - PUID=1002
        - PGID=1002
        - TZ=Europe/Paris
      volumes:
        - ./config:/config
        - /lib/modules:/lib/modules
      ports:
        - 51820:51820/udp
      sysctls:
        - net.ipv4.conf.all.src_valid_mark=1
        - net.ipv4.ip_forward=1
      restart: unless-stopped
  </code></pre>
  <p>Server conf:</p>
  <pre><code>[Interface]
  PrivateKey = XXXXXXXX
  ListenPort=51820
  Address = 10.0.0.1/24
  PostUp   = iptables -A FORWARD -i wg0 -j ACCEPT; iptables -A FORWARD -o %i -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE  
  PostDown = iptables -D FORWARD -i wg0 -j ACCEPT; iptables -D FORWARD -o %i -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE
  </code></pre>
  <p>Client conf:</p>
  <pre><code>[Interface]
  PrivateKey = XXXXX
  Address = 10.0.0.16/24
  
  [Peer]
  PublicKey = XXXX
  AllowedIPs = 192.168.0.0/24
  Endpoint = XXXXX
  PersistentKeepalive = 25
  </code></pre>
  <p>Connection to wireguard works, handshake is successful and I can ping machines on my local network and access internet.</p>
  <p>Some services are only accessible when on the local network (192.168.0.0/24) so I tried to add the DNS (dnsmasq hosted on same docker host) line in the client conf:</p>
  <pre><code>[Interface]
  PrivateKey = XXXXX
  Address = 10.0.0.16/24
  DNS = 192.168.0.13
  
  [Peer]
  PublicKey = XXXX
  AllowedIPs = 192.168.0.0/24
  Endpoint = XXXXX
  PersistentKeepalive = 25
  </code></pre>
  <p>When adding the dns line nothing is being resolved. I can still ping all machines but can't access local domains nor the internet.</p>
  <p>What can I do to solve this ?</p>
  <p>Thanks !</p>