From 18b2a20b3edb980543c0324239c045725c2b4816 Mon Sep 17 00:00:00 2001 From: Simon Zolin Date: Tue, 17 Mar 2020 14:48:34 +0300 Subject: [PATCH] Merge: + docker: add new sections Squashed commit of the following: commit 4d0977e06e32a8b2140b9599262874d37619e384 Author: Simon Zolin Date: Fri Mar 13 15:04:28 2020 +0300 + docker: Running on a system with 'resolved' daemon commit 79d1f3c9d20e8f3a3bbc645287dd2daa53ae8b1d Author: Simon Zolin Date: Wed Mar 11 13:20:16 2020 +0300 update commit 956cb38201d64fddc4e95165db8eee07ae1aba1c Author: Simon Zolin Date: Thu Feb 27 15:32:29 2020 +0300 + docker: Running DHCP server --- Docker.md | 42 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/Docker.md b/Docker.md index 3f86473..91e3bb3 100644 --- a/Docker.md +++ b/Docker.md @@ -21,6 +21,8 @@ 4. [Running dev builds](#unstable) 5. [Supported tags / architectures](#tags) 6. [Additional configuration](#configuration) +7. [Running DHCP server](#dhcp) +8. [Running on a system with 'resolved' daemon](#resolved-daemon) ## Introduction @@ -112,4 +114,42 @@ docker pull adguard/adguardhome:edge Upon the first execution, a file named `AdGuardHome.yaml` will be created, with default values written in it. You can modify the file while your AdGuard Home container is not running. Otherwise, any changes to the file will be lost because the running program will overwrite them. -Settings are stored in [YAML format](https://en.wikipedia.org/wiki/YAML), possible parameters that you can configure are listed on [this page](https://github.com/AdguardTeam/Adguardhome/wiki/Configuration). \ No newline at end of file +Settings are stored in [YAML format](https://en.wikipedia.org/wiki/YAML), possible parameters that you can configure are listed on [this page](https://github.com/AdguardTeam/Adguardhome/wiki/Configuration). + + +## Running DHCP server + +If you want to use AdGuardHome's DHCP server, you should pass `--network host` argument when creating the container: + + docker run --name adguardhome --network host -v /my/own/workdir:/opt/adguardhome/work -v /my/own/confdir:/opt/adguardhome/conf -d adguard/adguardhome + +This option instructs docker to use the host's network rather than docker-bridged network. +Note that port mapping with `-p` is not necessary now. + +A note from Docker Documentation: + + The host networking driver only works on Linux hosts, and is not supported on Docker Desktop for Mac, Docker Desktop for Windows, or Docker EE for Windows Server. + + +## Running on a system with 'resolved' daemon + +If you try to run AdGuardHome on a system where `resolved` daemon is working, docker will fail to bind on port 53, because `resolved` daemon is listening on `127.0.0.53:53`. + +Here's how you can disable DNSStubListener on your machine. + +Deactivate DNSStubListener and update DNS server address. Create a new file: `/etc/systemd/resolved.conf.d/adguardhome.conf` (create a `/etc/systemd/resolved.conf.d` directory if necessary): + + [Resolve] + DNS=127.0.0.1 + DNSStubListener=no + +Specifying "127.0.0.1" as DNS server address is necessary because otherwise the nameserver will be "127.0.0.53" which doesn't work without DNSStubListener. + +Activate another resolv.conf file: + + mv /etc/resolv.conf /etc/resolv.conf.backup + ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf + +Stop DNSStubListener: + + systemctl reload-or-restart systemd-resolved