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
729 stars 58 forks source link

Adguard home all interface #52

Closed Hanif-Faez closed 1 year ago

Hanif-Faez commented 2 years ago

Operating System

Raspberry Pi

Architecture

64-bit

Platform

Linux

Project

Aduard Home

Browser

Chrome

Issue

Not working

Issue Description

Hi.

Currently I'm using pi zero 2w. Is it possible to let Adguard listen on all interface since tailscale not working when listening to only wlan0. Just like pihole permit all origin? I already tried editing adguard.yaml and set dns interface to 0.0.0.0 and dns service won't start.

welcome[bot] commented 2 years ago

Thanks for opening your first issue here 🙋🕵️

trinib commented 2 years ago

I see.. yes try all interface

does that settings works for you?

trinib commented 2 years ago

I think it might need to listen to local lan. do you get a bind host error?

Hanif-Faez commented 2 years ago

I see.. yes try all interface

does that settings works for you?

I already tried listening to all interfaces with 0.0.0.0 but after reloading Adguard home, DNS service not working it spinning continuously. It only work when I followed your instruction with DNS interface wlan0 since my pi is wireless.

trinib commented 2 years ago

I see.. yes try all interface does that settings works for you?

I already tried listening to all interfaces with 0.0.0.0 but after reloading Adguard home, DNS service not working it spinning continuously. It only work when I followed your instruction with DNS interface wlan0 since my pi is wireless.

hmm i never tried with wifi..try making ip static on pi .

trinib commented 2 years ago

@Haniffaez your issue is tailscale not working with AGH using wlan0 right ?.. I wonder if something else is listening on address

Hanif-Faez commented 2 years ago

@Haniffaez your issue is tailscale not working with AGH using wlan0 right ?.. I wonder if something else is listening on address

Ya tailscale can't use DNS from Adguard if I set to wlan0. It need to listen on all interface just like pihole permit all origin. My pi IP already reserved on router. I follow this step on tailscale website. https://tailscale.com/kb/1114/pi-hole/

trinib commented 2 years ago

did you check to see if anything else on port 53?

sudo netstat -anp | grep 53
trinib commented 2 years ago

checking adguard logs as well can be helpful

Hanif-Faez commented 2 years ago

Sorry for late reply. Here is the output. Screenshots_2022-06-13-09-34-09 What am I looking at, I'm new to this. Do I need to enable verbosity and try again?

trinib commented 2 years ago

what you get for

sudo systemctl status AdGuardHome

&

sudo nano /var/log/AdGuardHome.err

Hanif-Faez commented 2 years ago

what you get for

sudo systemctl status AdGuardHome

&

sudo nano /var/log/AdGuardHome.err

Here is the output after I stopped Adguard service and went to Adguard.yaml to change the DNS interface to 0.0.0.0 1

Second output: sudo systemctl status AdGuardHome error

DNS service won't starts if it is set to 0.0.0.0 and the whole network is down error 3

Here is the Adguard.yaml error 2

trinib commented 2 years ago

hmmm try setting up firewall rules https://help.ubuntu.com/community/UFW

sudo apt install ufw -y
sudo ufw enable
sudo ufw allow from 0.0.0.0
sudo ufw allow in on wlan0
Hanif-Faez commented 2 years ago

Sorry I have to reinstall the whole pi after messing up with ufw. After reinstalling and configuring ufw, DNS service still can't start when set to 0.0.0.0 When checking for Adguard status, the service run but it keeps loading just like the screenshot I attached before.

err

trinib commented 2 years ago

@Haniffaez have you tried with a wired connection to see if it works? then you can know if its a wifi issue or not

trinib commented 2 years ago

when i use all interface i get in bind host 0.0.0.0

image

did you change that ?

image

Hanif-Faez commented 2 years ago

@Haniffaez have you tried with a wired connection to see if it works? then you can know if its a wifi issue or not

Ya wired connection might be the last resort but I need to get ethernet to micro usb adapter and see how it goes.

Hanif-Faez commented 2 years ago

when i use all interface i get in bind host 0.0.0.0

image

did you change that ?

image

Ya it does not work when I put 0.0.0.0 and DNS service seems like not even start up by looking at continuous loading icon on adguard dashboard. All interface only play nice when I use default upstream dns like cloudflare or Google dns without unbound and TLS forwarder.

trinib commented 2 years ago

so that 192.168.1.11 address is for tailscale to work ?

Hanif-Faez commented 2 years ago

so that 192.168.1.11 address is for tailscale to work ?

I used default upstream dns (cloudflare) before and it work well with tailscale but it need to listen on all interface. When I use unbound and TLS forwarder, set interface to 0.0.0.0 the dns service won't start and it keep loading until I revert back changes to 192.168.1.11

Hanif-Faez commented 2 years ago

when i use all interface i get in bind host 0.0.0.0 image did you change that ? image

Ya it does not work when I put 0.0.0.0 and DNS service seems like not even start up by looking at continuous loading icon on adguard dashboard. All interface only play nice when I use default upstream dns like cloudflare or Google dns without unbound and TLS forwarder.

sudo nano /etc/resolv.conf nameserver 127.0.0.1 save and exit sudo systemctl restart systemd-resolved

now you can use bind host 0.0.0.0 for AdGuardHome

sudo systemctl status systemd-resolved ● systemd-resolved.service - Network Name Resolution Loaded: loaded (/lib/systemd/system/systemd-resolved.service; enabled; vendor preset: enabled) Active: active (running) since Tue 2022-06-14 19:19:15 EEST; 2h 30min ago Docs: man:systemd-resolved.service(8) man:org.freedesktop.resolve1(5) https://www.freedesktop.org/wiki/Software/systemd/writing-network-configuration-managers https://www.freedesktop.org/wiki/Software/systemd/writing-resolver-clients Main PID: 746 (systemd-resolve) Status: "Processing requests..." Tasks: 1 (limit: 4379) Memory: 7.8M CPU: 146ms CGroup: /system.slice/systemd-resolved.service └─746 /lib/systemd/systemd-resolved

Jun 14 19:19:15 homeserversystemd[1]: Starting Network Name Resolution... Jun 14 19:19:15 homeserver systemd-resolved[746]: Positive Trust Anchors: Jun 14 19:19:15 homeserver systemd-resolved[746]: Negative trust anchors: home.arpa 10.in-addr.arpa 16.172.in-addr.arpa 17.172.in-addr.arpa 18.1> Jun 14 19:19:15homeserver systemd-resolved[746]: Using system hostname '-homeserver'. Jun 14 19:19:15 homeserver systemd[1]: Started Network Name Resolution.

2022-06-14_21-49-00 2022-06-14_21-51-39

I guess mine already set to 127.0.0.1

Screenshots_2022-06-15-15-28-46

trinib commented 2 years ago

so that 192.168.1.11 address is for tailscale to work ?

I used default upstream dns (cloudflare) before and it work well with tailscale but it need to listen on all interface. When I use unbound and TLS forwarder, set interface to 0.0.0.0 the dns service won't start and it keep loading until I revert back changes to 192.168.1.11

its a long shot but try adding nameserver 192.168.1.11 in resolv.conf

sudo apt install resolvconf
sudo systemctl start resolvconf.service
sudo systemctl enable resolvconf.service
sudo systemctl status resolvconf.service
sudo nano /etc/resolvconf/resolv.conf.d/head

add nameserver 192.168.1.11

sudo systemctl restart resolvconf.service
sudo systemctl restart systemd-resolved.service

check sudo nano /etc/resolv.conf

restart pi just in case

see if any change with unbound etc🙏

if not you will have to ask on https://github.com/AdguardTeam/AdGuardHome

trinib commented 2 years ago

@Haniffaez or try nameserver 0.0.0.0 if nameserver 192.168.1.11 do not work

Hanif-Faez commented 2 years ago

so that 192.168.1.11 address is for tailscale to work ?

I used default upstream dns (cloudflare) before and it work well with tailscale but it need to listen on all interface. When I use unbound and TLS forwarder, set interface to 0.0.0.0 the dns service won't start and it keep loading until I revert back changes to 192.168.1.11

its a long shot but try adding nameserver 192.168.1.11 in resolv.conf

sudo apt install resolvconf
sudo systemctl start resolvconf.service
sudo systemctl enable resolvconf.service
sudo systemctl status resolvconf.service
sudo nano /etc/resolvconf/resolv.conf.d/head

add nameserver 192.168.1.11

sudo systemctl restart resolvconf.service
sudo systemctl restart systemd-resolved.service

check sudo nano /etc/resolv.conf

restart pi just in case

see if any change with unbound etc🙏

if not you will have to ask on https://github.com/AdguardTeam/AdGuardHome

I have tried all the steps but it still not working after adding nameserver and editing Adguard.yaml to listen on 0.0.0.0 Got the same error DNS server is starting up and it keeps loading.

3

Never mind, I just use this without tailscale or went back to default upstream DNS if I need.

Hanif-Faez commented 2 years ago

Wait can I close this? Sorry, this is my first post. I guess need to refer Adguardhome.

trinib commented 2 years ago

@Haniffaez if you found solution from AGH community.. can you please mention solution here and then you can close .. thanks