# Adguard Home DNS adress with VPNClient

**URL:** https://forum.yunohost.org/t/adguard-home-dns-adress-with-vpnclient/21530
**Category:** Support apps
**Tags:** french
**Created:** [October 2, 2022, 5:56pm UTC](https://forum.yunohost.org/t/adguard-home-dns-adress-with-vpnclient/21530 "2022-10-02T17:56:04Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![Optogram](https://forum.yunohost.org/user_avatar/forum.yunohost.org/optogram/32/13952_2.png) [@Optogram](https://forum.yunohost.org/u/Optogram)
#### Post date: [October 2, 2022, 5:56pm UTC](https://forum.yunohost.org/t/adguard-home-dns-adress-with-vpnclient/21530/1 "2022-10-02T17:56:05Z")

</div>

### 🇬🇧 My YunoHost server

**Hardware:** Intel NUC  
**YunoHost version:** 11.0.9.15  
**I have access to my server :** Through everything  
**Are you in a special context or did you perform some particular tweaking on your YunoHost instance ?** : yes  
**If yes, please explain :** I’m using a VPN from [Alsace Réseau Neutre](http://arn-fai.net/)

### Description of my issue

It all began in [this topic](https://forum.yunohost.org/t/acces-yunohost-sur-meme-reseau-local-impossible-yunohost-access-from-same-local-network-wont-work/17692/4), where the answer didn’t helped me. Since that post, I added equipment into my local network and this issue is getting more annoying.

The issue is simple, I can’t join domains hosted on my Nuc from my local network without modifying my host file, even with VPN who gives them a totally different IP from mine.

So, since I don’t want and can’t modify host file for each of my equipment and modify them everytime I’m connected to an other network, I looked for another solution.

I’m currently using Adguard Home, added custom local redirections to my domains, managed to set DNS into my ISP router. The only thing is that Adguard Home is configured with my external VPN IP Adress, and I just want to use it locally.

## Is it possible ?

## 🇫🇷 Modèle de message (français)

### Mon serveur YunoHost

**Matériel:** Intel NUC  
**Version de YunoHost:** 11.0.9.15  
**J’ai accès à mon serveur :** Avec tout  
**Êtes-vous dans un contexte particulier ou avez-vous effectué des modificiations particulières sur votre instance ?** : oui  
**Si oui, expliquer:** J’utilise un VPN d’[Alsace Réseau Neutre](http://arn-fai.net/)

### Description du problème

Tout a commencé dans [ce sujet](https://forum.yunohost.org/t/acces-yunohost-sur-meme-reseau-local-impossible-yunohost-access-from-same-local-network-wont-work/17692/4), où la réponse n’a pas du tout été satisfaisante pour mon cas. Depuis, j’ai ajouté des équipements sur mon réseau local et le problème devient de plus en plus gênant.

Le problème est simple, je ne peux pas joindre les domaines hébergés sur mon NUC, depuis mon réseau local sans modifier les fichiers hosts de mes équipements, bien qu’il utilise un VPN et que le traffic soit dirigé sur une IP totalement différente de la mienne.

Vu que je ne souhaite pas modifier et ne peut pas modifier les fichiers host de tout mes équipements à chaque fois que je quitte mon domicile, j’ai cherché une solution.

J’ai mis à l’essai Adguard Home, ajouté des redirections DNS vers mes domaines sur l’adresse IP locale, ajouté le DNS dans les paramètres de la box de mon FAI. Je n’ai qu’un seul souci, Adguard est configuré avec l’adresse IP externe de mon VPN comme adresse de configuration, je ne peux donc pas ajouter une IP locale comme fournisseur DNS, et je ne peux pas non plus restreindre son utilisation en réseau local.

Est-ce possible de le faire ? Est-ce bien le comportement prévu ?

Merci de votre aide ! 🙂

---

<div class="post-metadata">

### Author: ![Optogram](https://forum.yunohost.org/user_avatar/forum.yunohost.org/optogram/32/13952_2.png) [@Optogram](https://forum.yunohost.org/u/Optogram)
#### Post date: [October 3, 2022, 11:53am UTC](https://forum.yunohost.org/t/adguard-home-dns-adress-with-vpnclient/21530/2 "2022-10-03T11:53:23Z")

</div>

Sorry for the double post, the situation has changed.

I rebooted my server yesterday and now Adguard doesn’t even run. A network issue seems to block the proper run of the app 😑

IPs are masked

```auto
oct. 03 12:37:49 systemd[1]: Started AdGuard Home: Network-level blocker.
oct. 03 12:37:49 AdGuardHome[39609]: 2022/10/03 12:37:49.966920 [info] AdGuard Home, version v0.107.13
oct. 03 12:37:49 AdGuardHome[39609]: 2022/10/03 12:37:49.972058 [error] creating dhcpv4 srv: dhcpv4: <nil> is not an IP address
oct. 03 12:37:49 AdGuardHome[39609]: 2022/10/03 12:37:49.986407 [info] Initializing auth module: /var/www/adguardhome/data/sessions.db
oct. 03 12:37:49 AdGuardHome[39609]: 2022/10/03 12:37:49.986578 [info] auth: initialized. users:1 sessions:3
oct. 03 12:37:49 AdGuardHome[39609]: 2022/10/03 12:37:49.986602 [info] Initialize web module
oct. 03 12:37:49 AdGuardHome[39609]: 2022/10/03 12:37:49.987752 [info] DNS cache is enabled
oct. 03 12:37:49 AdGuardHome[39609]: 2022/10/03 12:37:49.987799 [info] MaxGoroutines is set to 300
oct. 03 12:37:50 AdGuardHome[39609]: 2022/10/03 12:37:50.015189 [info] AdGuard Home is available at the following addresses:
oct. 03 12:37:50 AdGuardHome[39609]: 2022/10/03 12:37:50.015648 [info] Go to http://127.0.0.1:3000
oct. 03 12:37:50 AdGuardHome[39609]: 2022/10/03 12:37:50.015675 [info] Go to http://[::1]:3000
oct. 03 12:37:50 AdGuardHome[39609]: 2022/10/03 12:37:50.015684 [info] Go to http://192.168.1.20:3000
oct. 03 12:37:50 AdGuardHome[39609]: 2022/10/03 12:37:50.015694 [info] Go to http://[xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx]:3000
oct. 03 12:37:50 AdGuardHome[39609]: 2022/10/03 12:37:50.015704 [info] Go to http://[[xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx]:3000
oct. 03 12:37:50 AdGuardHome[39609]: 2022/10/03 12:37:50.015712 [info] Go to http://xxx.xxx.xxx.xxx:3000
oct. 03 12:37:50 AdGuardHome[39609]: 2022/10/03 12:37:50.015720 [info] Go to http://[xxxx:xxxx:xxxx:xxx::x]:3000
oct. 03 12:37:50 AdGuardHome[39609]: 2022/10/03 12:37:50.388632 [info] Starting the DNS proxy server
oct. 03 12:37:50 AdGuardHome[39609]: 2022/10/03 12:37:50.388671 [info] Ratelimit is enabled and set to 20 rps
oct. 03 12:37:50 AdGuardHome[39609]: 2022/10/03 12:37:50.388679 [info] The server is configured to refuse ANY requests
oct. 03 12:37:50 AdGuardHome[39609]: 2022/10/03 12:37:50.388689 [info] DNS cache is enabled
oct. 03 12:37:50 AdGuardHome[39609]: 2022/10/03 12:37:50.388703 [info] MaxGoroutines is set to 300
oct. 03 12:37:50 AdGuardHome[39609]: 2022/10/03 12:37:50.388723 [info] Creating the UDP server socket
oct. 03 12:37:50 AdGuardHome[39609]: 2022/10/03 12:37:50.388835 [info] Listening to udp:/xxx.xxx.xxx.xxx:53
oct. 03 12:37:50 AdGuardHome[39609]: 2022/10/03 12:37:50.388847 [info] Creating the UDP server socket
oct. 03 12:37:50 AdGuardHome[39609]: 2022/10/03 12:37:50.399950 [fatal] couldn't start forwarding DNS server: listening to udp socket: listen udp [xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx]:53: bind: cannot assign requested address
oct. 03 12:37:50 systemd[1]: adguardhome.service: Main process exited, code=exited, status=1/FAILURE
oct. 03 12:37:50 systemd[1]: adguardhome.service: Failed with result 'exit-code'.
oct. 03 12:37:53 systemd[1]: Stopped AdGuard Home: Network-level blocker.

```

---

<div class="post-metadata">

### Author: ![Optogram](https://forum.yunohost.org/user_avatar/forum.yunohost.org/optogram/32/13952_2.png) [@Optogram](https://forum.yunohost.org/u/Optogram)
#### Post date: [October 14, 2022, 8:32pm UTC](https://forum.yunohost.org/t/adguard-home-dns-adress-with-vpnclient/21530/3 "2022-10-14T20:32:46Z")

</div>

I allow myself to reup the post.

What I wanted to achieve is using Adguard Home 🙂

- On my local network
- To clean my browsing
- Add custom local DNS rules to redirect domains to local servers

And in bonus :

- Using with my smartphones outside if possible
  - But I don’t like the idea of opening Adguard Home on the internet

But, for now :

- Adguard won’t start
- And he’s using my VPN external IP, so it will be open in the wild 😕

Thanks for your time 🙂

---

<div class="post-metadata">

### Author: ![charly](https://forum.yunohost.org/letter_avatar_proxy/v4/letter/c/9d8465/32.png) [@charly](https://forum.yunohost.org/u/charly)
#### Post date: [October 15, 2022, 8:15am UTC](https://forum.yunohost.org/t/adguard-home-dns-adress-with-vpnclient/21530/4 "2022-10-15T08:15:24Z")

</div>

Hi, salut,

I used to do that with dnsmasq, which is already included and running by default in Yunohost.

Here are the notes that I had taken then :

- Mettre en écoute l’ip **10.0.242.1** de l’interface réseau concernée (celle qui va recevoir les requêtes DNS)

nano /etc/dnsmasq.conf

Et rajouter listen-address=10.0.242.1 (IP de l’interface qui va recevoir les requêtes)

```auto
domain-needed
expand-hosts
listen-address=127.0.0.1
listen-address=10.0.242.1
resolv-file=/etc/resolv.dnsmasq.conf
cache-size=256

```

Puis éditer le fichier host de yunohost pour y rajouter adresse IP qui va recevoir les requêtes DNS + le(s) domaine(s) :

```auto
vi /etc/hosts 

127.0.0.1 localhost
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
10.0.242.1 mondomaine.fr www.mondomaine.fr

```

Puis redémarrer le service dnsmasq :  
`systemctl restart dnsmasq`

Indiquer dans la box internet l’adresse IP locale du Yunohost comme serveur DNS.

Ca devrait fonctionner.

Tiens nous au courant.

A +

---

<div class="post-metadata">

### Author: ![Optogram](https://forum.yunohost.org/user_avatar/forum.yunohost.org/optogram/32/13952_2.png) [@Optogram](https://forum.yunohost.org/u/Optogram)
#### Post date: [October 15, 2022, 10:34am UTC](https://forum.yunohost.org/t/adguard-home-dns-adress-with-vpnclient/21530/5 "2022-10-15T10:34:41Z")

</div>

Merci pour ton retour,  
mes connaissances sont limités, j’ai donc quelques questions :

Je ne comprends pas ce qu’est l’IP **10.0.242.1** et le rôle qu’elle joue 😅 C’est une IP locale ?  
Sur quelles adresses DNSmasq ira chercher si résolution de nom de domaines ?  
Est-ce que cette solution remplace les DNS de la box ou vient en complément ?  
Enfin, c’est une solution annexe, elle ne résouds pas l’utilisation d’Adguard ?

Merci de tes réponses 🙂

---

<div class="post-metadata">

### Author: ![charly](https://forum.yunohost.org/letter_avatar_proxy/v4/letter/c/9d8465/32.png) [@charly](https://forum.yunohost.org/u/charly)
#### Post date: [October 15, 2022, 7:25pm UTC](https://forum.yunohost.org/t/adguard-home-dns-adress-with-vpnclient/21530/6 "2022-10-15T19:25:26Z")

</div>

Salut,

En fait, 10…0.242.1 c’est à remplacer par l’adresse IP de ton yunohost sur ton réseau local, sur le réseau sur lequel les requêtes DNS seront envoyées (et sur lequel sont connectés les autres appareils du réseau local). (pas son adresse IP sur le VPN, pas son adresse IPpublique, son adresse sur le réseau local)

Il se peut que ce soit quelque chose comme 192.168.1.X

Ensuite, il faut bien rajouter tous tes domaines dans le fichier /etc/hosts parce que dnsmasq va inspecter ce fichier et “résoudre” selon les infos qui s’y trouvent.

Pour finir, redémarrer le service dnsmasq pour qu’il prenne en compte les changements.

Et inscrire l’adresse IP du réseau local de ton yunohost dans l’option serveur dns de ta machinbox.

Tu n’oublieras pas de déconnecter reconnecter chaque appareil pour qu’il prenne en compte le nouveau serveur DNS (ton yunohost).

Ensuite, un ping vers ton domaine sur le réseau local devrait pinguer vers l’adresse IP locale de ton yunohost.

Sinon : Non, cela ne résoud rien à ton problème de Adguard, désolé 🙂

Bon courage !

Et pour que le changement

EDIT : Je viens d’essayer rapidement chez moi, ça fonctionne.  
Je crois que ça vaudrait le coup de mettre à jour la doc de Yunohost pour proposer cette solution. Je vais voir si j’ai le temps dans le weekend.

---

<div class="post-metadata">

### Author: ![Optogram](https://forum.yunohost.org/user_avatar/forum.yunohost.org/optogram/32/13952_2.png) [@Optogram](https://forum.yunohost.org/u/Optogram)
#### Post date: [October 16, 2022, 5:57pm UTC](https://forum.yunohost.org/t/adguard-home-dns-adress-with-vpnclient/21530/7 "2022-10-16T17:57:06Z")

</div>

Pour moi, c’est bof : [hastebin](https://paste.yunohost.org/sukuvecitu)

```auto
LOGFILE: journalctl
-- Journal begins at Sat 2022-09-24 09:18:39 CEST, ends at Sun 2022-10-16 19:43:21 CEST. --
oct. 16 18:08:08 dnsmasq[12048]: warning: no addresses found for interface wlp2s0
oct. 16 18:08:08 dnsmasq[12048]: warning: no addresses found for interface wlp2s0
oct. 16 18:08:08 dnsmasq[12048]: Lecture de /etc/resolv.dnsmasq.conf
oct. 16 18:08:08 dnsmasq[12048]: utilise le serveur de nom 2a00:5881:8100:1000::3#53
oct. 16 18:08:08 dnsmasq[12048]: utilise le serveur de nom 89.234.141.66#53
oct. 16 18:08:08 dnsmasq[12048]: lecture /etc/hosts - 6 adresses
oct. 16 18:08:08 systemd[1]: Started dnsmasq - A lightweight DHCP and caching DNS server.
oct. 16 19:28:02 systemd[1]: Stopping dnsmasq - A lightweight DHCP and caching DNS server...
oct. 16 19:28:02 dnsmasq[12048]: sortie sur réception du signal SIGTERM
oct. 16 19:28:02 systemd[1]: dnsmasq.service: Succeeded.
oct. 16 19:28:02 systemd[1]: Stopped dnsmasq - A lightweight DHCP and caching DNS server.
oct. 16 19:28:02 systemd[1]: dnsmasq.service: Consumed 1.386s CPU time.
oct. 16 19:28:02 systemd[1]: Starting dnsmasq - A lightweight DHCP and caching DNS server...
oct. 16 19:28:02 dnsmasq[22195]: mauvaise optionà la ligne 5 de /etc/dnsmasq.conf
oct. 16 19:28:02 dnsmasq[22195]: IMPOSSIBLE de démarrer
oct. 16 19:28:02 systemd[1]: dnsmasq.service: Control process exited, code=exited, status=1/FAILURE
oct. 16 19:28:02 systemd[1]: dnsmasq.service: Failed with result 'exit-code'.
oct. 16 19:28:02 systemd[1]: Failed to start dnsmasq - A lightweight DHCP and caching DNS server.
oct. 16 19:28:20 systemd[1]: Starting dnsmasq - A lightweight DHCP and caching DNS server...
oct. 16 19:28:21 systemd[1]: dnsmasq.service: Control process exited, code=exited, status=1/FAILURE
oct. 16 19:28:21 systemd[1]: dnsmasq.service: Failed with result 'exit-code'.
oct. 16 19:28:21 systemd[1]: Failed to start dnsmasq - A lightweight DHCP and caching DNS server.
oct. 16 19:29:22 systemd[1]: Starting dnsmasq - A lightweight DHCP and caching DNS server...
oct. 16 19:29:22 dnsmasq[23047]: mauvaise optionà la ligne 5 de /etc/dnsmasq.conf
oct. 16 19:29:22 dnsmasq[23047]: IMPOSSIBLE de démarrer
oct. 16 19:29:22 systemd[1]: dnsmasq.service: Control process exited, code=exited, status=1/FAILURE
oct. 16 19:29:22 systemd[1]: dnsmasq.service: Failed with result 'exit-code'.
oct. 16 19:29:22 systemd[1]: Failed to start dnsmasq - A lightweight DHCP and caching DNS server.
oct. 16 19:43:15 systemd[1]: Starting dnsmasq - A lightweight DHCP and caching DNS server...
oct. 16 19:43:15 dnsmasq[30153]: demarré, version 2.85 (taille de cache 256)
oct. 16 19:43:15 dnsmasq[30153]: options à la compilation : IPv6 GNU-getopt DBus no-UBus i18n IDN2 DHCP DHCPv6 no-Lua TFTP conntrack ipset auth cryptohash DNSSEC loop-detect inotify dumpfile
oct. 16 19:43:15 dnsmasq[30153]: warning: no addresses found for interface wlp2s0
oct. 16 19:43:15 dnsmasq[30153]: warning: no addresses found for interface wlp2s0
oct. 16 19:43:15 dnsmasq[30153]: warning: no addresses found for interface wlp2s0
oct. 16 19:43:15 dnsmasq[30153]: warning: no addresses found for interface wlp2s0
oct. 16 19:43:15 dnsmasq[30153]: warning: no addresses found for interface wlp2s0
oct. 16 19:43:15 dnsmasq[30153]: warning: no addresses found for interface wlp2s0
oct. 16 19:43:15 dnsmasq[30153]: warning: no addresses found for interface wlp2s0
oct. 16 19:43:15 dnsmasq[30153]: warning: no addresses found for interface wlp2s0
oct. 16 19:43:15 dnsmasq[30153]: warning: no addresses found for interface wlp2s0
oct. 16 19:43:15 dnsmasq[30153]: warning: no addresses found for interface wlp2s0
oct. 16 19:43:15 dnsmasq[30153]: warning: no addresses found for interface wlp2s0
oct. 16 19:43:15 dnsmasq[30153]: warning: no addresses found for interface wlp2s0
oct. 16 19:43:15 dnsmasq[30153]: warning: no addresses found for interface wlp2s0
oct. 16 19:43:15 dnsmasq[30153]: warning: no addresses found for interface wlp2s0
oct. 16 19:43:15 dnsmasq[30153]: Lecture de /etc/resolv.dnsmasq.conf
oct. 16 19:43:15 dnsmasq[30153]: utilise le serveur de nom 2a00:5881:8100:1000::3#53
oct. 16 19:43:15 dnsmasq[30153]: utilise le serveur de nom 89.234.141.66#53
oct. 16 19:43:15 dnsmasq[30153]: lecture /etc/hosts - 11 adresses
oct. 16 19:43:15 systemd[1]: Started dnsmasq - A lightweight DHCP and caching DNS server.

```

Dnsmasq ne se lance plus après les modifications 😕

J’ai donc supprimé les lignes suivantes, et c’est revenu. Je reprécise que j’utilise un VPN, si cela peut aider.

```auto
listen-address=127.0.0.1
listen-address=192.168.1.xx

```

Voilà le contenu de mon dnsmasq.conf

```auto
domain-needed
expand-hosts
localise-queries
interface=lo

resolv-file=/etc/resolv.dnsmasq.conf
cache-size=256

```

---

<div class="post-metadata">

### Author: ![system](https://forum.yunohost.org/uploads/default/original/2X/f/f59fe8e3ee6b100b4f574d30d6e30479c68b89f0.png) [@system](https://forum.yunohost.org/u/system)
#### Post date: [October 31, 2022, 5:57pm UTC](https://forum.yunohost.org/t/adguard-home-dns-adress-with-vpnclient/21530/8 "2022-10-31T17:57:26Z")

</div>

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.
