trinib / AdGuard-WireGuard-Unbound-DNScrypt

Linux ultimate self-hosted network security guide ║ Linux 终极自托管网络安全指南 ║ Guía definitiva de seguridad de red autohospedada de Linux ║ लिनक्स परम स्व-होस्टेड नेटवर्क सुरक्षा गाइड ║ Окончательное руководство по безопасности собственной сети Linux
MIT License
772 stars 60 forks source link

AdGuard Not Working On Host Machine #83

Open bigverm23 opened 2 weeks ago

bigverm23 commented 2 weeks ago

Operating System

Ubuntu

Architecture

64-bit

Platform

Linux

Project

Aduard Home

Browser

Firefox

Issue

Other (explain in description)

Issue Description

I have Unbound installed and listening on localhost:53, and DNSCrypt (anonymized) installed and listening on localhost:5353.

I can install AdGuardHome just fine on the host machine, 10.0.0.11, and it works for all networked devices EXCEPT the host. No logs are being shown in the query log either. How do I resolve this?

COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME AdGuardHo 512522 root 11u IPv4 1902545 0t0 UDP 10.0.0.11:domain AdGuardHo 512522 root 12u IPv4 1902546 0t0 TCP 10.0.0.11:domain (LISTEN) unbound 512909 unbound 3u IPv4 1906257 0t0 UDP localhost:domain unbound 512909 unbound 4u IPv4 1906258 0t0 TCP localhost:domain (LISTEN)

COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME dnscrypt- 1554 root 6u IPv4 25824 0t0 UDP localhost:mdns dnscrypt- 1554 root 7u IPv4 25825 0t0 TCP localhost:5353 (LISTEN) dnscrypt- 1554 root 8u IPv6 25826 0t0 UDP ip6-localhost:mdns dnscrypt- 1554 root 9u IPv6 25827 0t0 TCP ip6-localhost:5353 (LISTEN)

I have dnsstublistener disabled according to https://github.com/trinib/AdGuard-WireGuard-Unbound-Cloudflare/issues/27

welcome[bot] commented 2 weeks ago

Thanks for opening your first issue here 🙋🕵️

trinib commented 2 weeks ago

Operating System

Ubuntu

Architecture

64-bit

Platform

Linux

Project

Aduard Home

Browser

Firefox

Issue

Other (explain in description)

Issue Description

I have Unbound installed and listening on localhost:53, and DNSCrypt (anonymized) installed and listening on localhost:5353.

I can install AdGuardHome just fine on the host machine, 10.0.0.11, and it works for all networked devices EXCEPT the host. No logs are being shown in the query log either. How do I resolve this?

COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME AdGuardHo 512522 root 11u IPv4 1902545 0t0 UDP 10.0.0.11:domain AdGuardHo 512522 root 12u IPv4 1902546 0t0 TCP 10.0.0.11:domain (LISTEN) unbound 512909 unbound 3u IPv4 1906257 0t0 UDP localhost:domain unbound 512909 unbound 4u IPv4 1906258 0t0 TCP localhost:domain (LISTEN)

COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME dnscrypt- 1554 root 6u IPv4 25824 0t0 UDP localhost:mdns dnscrypt- 1554 root 7u IPv4 25825 0t0 TCP localhost:5353 (LISTEN) dnscrypt- 1554 root 8u IPv6 25826 0t0 UDP ip6-localhost:mdns dnscrypt- 1554 root 9u IPv6 25827 0t0 TCP ip6-localhost:5353 (LISTEN)

I have dnsstublistener disabled according to #27

It sounds like the setup you have for DNS resolution on your host machine could be running into a conflict with AdGuard Home, Unbound, and DNSCrypt operating on overlapping ports and potentially not forwarding requests properly. Here’s a breakdown of the configuration you need and adjustments you can make to resolve this:

Step-by-Step Solution

1. Verify DNS Forwarding Configuration in AdGuard Home

2. Configure Unbound to Use DNSCrypt

3. Ensure No Port Conflicts on localhost:53

4. Modify the DNS Settings on the Host Machine (10.0.0.11)

5. Restart All Services

6. Test DNS Resolution on the Host


This setup should route all DNS queries from the host machine to AdGuard Home, which then routes to Unbound and finally DNSCrypt, with each service handling requests as intended.

bigverm23 commented 2 weeks ago

just want to make sure,but Unbound ONLY works if I set a DNS provider in the config as well...does this unbound config portion look right?

server:
    tls-cert-bundle: /etc/ssl/certs/ca-certificates.crt
forward-zone:
  name: "."
  forward-tls-upstream: yes

  #dnscryptproxy
  forward-addr: 127.0.0.1@5353
  forward-addr: ::1@5353

  #AdGuardDNS
  forward-addr: 94.140.14.14@853#dns.adguard.com
  forward-addr: 94.140.15.15@853#dns.adguard.com
  forward-addr: 2a10:50c0::ad1:ff@853#dns.adguard.com
  forward-addr: 2a10:50c0::ad2:ff@853#dns.adguard.com

It seems to be working and AdGuard Home is resolving host as it should, but it seems to be very slow

; <<>> DiG 9.20.0-2ubuntu3-Ubuntu <<>> @10.0.0.11 example.com
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 43107
;; flags: qr rd ra ad; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
;; QUESTION SECTION:
;example.com.           IN  A

;; ANSWER SECTION:
example.com.        1664    IN  A   93.184.215.14

;; Query time: 631 msec
;; SERVER: 10.0.0.11#53(10.0.0.11) (UDP)
;; WHEN: Wed Nov 06 05:28:02 EST 2024
;; MSG SIZE  rcvd: 56