### "Get install settings" command Source: https://github.com/adguardteam/adguardhome/blob/master/AGHTechDoc.md Example request and response for getting installation settings. ```bash GET /control/install/get_addresses ``` ```json { "web_port":80, "dns_port":53, "interfaces":{ "enp2s0":{"name":"enp2s0","mtu":1500,"hardware_address":"","ip_addresses":["",""],"flags":"up|broadcast|multicast"}, "lo":{"name":"lo","mtu":65536,"hardware_address":"","ip_addresses":["127.0.0.1","::1"],"flags":"up|loopback"}, } } ``` -------------------------------- ### Install AdGuard Home as a service Source: https://github.com/adguardteam/adguardhome/wiki/Getting-Started Command to install AdGuard Home as a system service. ```shell sudo ./AdGuardHome -s install ``` -------------------------------- ### Install AdGuard Home with wget Source: https://github.com/adguardteam/adguardhome/blob/master/README.md This command installs AdGuard Home using wget, providing an alternative to curl for automated setup on compatible systems. The -v flag enables verbose output. ```shell wget --no-verbose -O - https://raw.githubusercontent.com/AdguardTeam/AdGuardHome/master/scripts/install.sh | sh -s -- -v ``` -------------------------------- ### Install AdGuard Home as a service Source: https://github.com/adguardteam/adguardhome/wiki/Getting-Started Command to install AdGuard Home as a service after unpacking the archive and entering the AdGuardHome directory. ```shell ./AdGuardHome -s install ``` -------------------------------- ### Run AdGuard Home with sudo Source: https://github.com/adguardteam/adguardhome/wiki/Getting-Started Command to run AdGuard Home with superuser privileges on Unix-like systems. ```shell sudo ./AdGuardHome ``` -------------------------------- ### Install necessary packages Source: https://github.com/adguardteam/adguardhome/wiki/VPS Ensures the VPS has the required minimal requirements for AdGuard Home installation. ```shell apt-get install sudo nano bind9-host ``` -------------------------------- ### Get Version Command - Example version.json Source: https://github.com/adguardteam/adguardhome/blob/master/AGHTechDoc.md An example of the version.json data structure that AdGuard Home might download from GitHub. ```json { "version": "v0.95-hotfix", "announcement": "AdGuard Home v0.95-hotfix is now available!", "announcement_url": "", "download_windows_amd64": "", "download_windows_386": "", "download_darwin_amd64": "", "download_linux_amd64": "", "download_linux_386": "", "download_linux_arm": "", "download_linux_arm64": "", "download_linux_mips": "", "download_linux_mipsle": "", "selfupdate_min_version": "v0.0" } ``` -------------------------------- ### Install Qemu for Docker Multiarch Builds Source: https://github.com/adguardteam/adguardhome/blob/master/README.md Install Qemu user-static binaries on Linux to enable Docker Buildx to build multi-architecture images. ```sh docker run --rm --privileged multiarch/qemu-user-static --reset -p yes --credential yes ``` -------------------------------- ### Workaround for mmap(2) limitations Source: https://github.com/adguardteam/adguardhome/wiki/Getting-Started This example shows how to create symbolic links to resolve issues with file systems that do not support the mmap(2) system call. ```sh ln -s ${YOUR_AGH_PATH}/data/stats.db /tmp/stats.db ln -s ${YOUR_AGH_PATH}/data/sessions.db /tmp/sessions.db ``` -------------------------------- ### Install AdGuard Home Beta Version Source: https://github.com/adguardteam/adguardhome/blob/master/README.md Use this script to install a beta version of AdGuard Home. Ensure you have curl installed. ```sh curl -s -S -L https://raw.githubusercontent.com/AdguardTeam/AdGuardHome/master/scripts/install.sh | sh -s -- -c beta ``` -------------------------------- ### AdGuard Home service commands Source: https://github.com/adguardteam/adguardhome/wiki/Getting-Started Common commands to manage the AdGuard Home service. ```shell AdGuardHome -s uninstall AdGuardHome -s start AdGuardHome -s stop AdGuardHome -s restart AdGuardHome -s status ``` -------------------------------- ### AdGuard Home Installation Script with Custom Path Source: https://github.com/adguardteam/adguardhome/wiki/FAQ Command to install AdGuard Home directly into /usr/local/bin using the install script. ```bash curl -s -S -L 'https://raw.githubusercontent.com/AdguardTeam/AdGuardHome/master/scripts/install.sh' | sh -s -- -o '/usr/local/bin' -v ``` -------------------------------- ### Install Playwright Browsers Source: https://github.com/adguardteam/adguardhome/blob/master/README.md Download and install the browser binaries required by Playwright for running E2E tests. ```sh npx playwright install ``` -------------------------------- ### Install AdGuard Home as a Service Source: https://github.com/adguardteam/adguardhome/wiki/Raspberry-Pi Command to install AdGuard Home as a system service. ```shell cd ./AdGuardHome/ sudo ./AdGuardHome -s install ``` -------------------------------- ### /etc/hosts-style syntax example Source: https://github.com/adguardteam/adguardhome/wiki/Hosts-Blocklists Example of blocklist entries using /etc/hosts-style syntax, including comments. ```none IP_address canonical_hostname [aliases...] ``` -------------------------------- ### ipset configuration example Source: https://github.com/adguardteam/adguardhome/wiki/Configuration Example syntax for associating domain names with ipset lists for IP address management. ```none DOMAIN[,DOMAIN,…]/IPSET_NAME[,IPSET_NAME,…] ``` -------------------------------- ### Domain Precedence Example Source: https://github.com/adguardteam/adguardhome/wiki/Configuration Example illustrating how more specific domains take precedence over less specific ones. ```none [/host.com/]1.2.3.4 [/www.host.com/]2.3.4.5 ``` -------------------------------- ### Wildcard Subdomain Example Source: https://github.com/adguardteam/adguardhome/wiki/Configuration Example demonstrating the special meaning of '*' for any subdomain since v0.108.0-b.8. ```none --upstream=[/*.host.com/]1.2.3.4 ``` -------------------------------- ### Install E2E Test Dependencies Source: https://github.com/adguardteam/adguardhome/blob/master/README.md Install the necessary Node.js dependencies for running End-to-End (E2E) frontend tests. ```sh npm install ``` -------------------------------- ### TXT Record Rewrite Example Source: https://github.com/adguardteam/adguardhome/wiki/Hosts-Blocklists Example of adding a TXT record with a string value. ```adblock ||example.com^$dnsrewrite=NOERROR;TXT;hello_world ``` -------------------------------- ### Windows service installation Source: https://github.com/adguardteam/adguardhome/wiki/Getting-Started Command to install AdGuard Home as a Windows service. ```shell AdGuardHome.exe -s install ``` -------------------------------- ### Install AdGuard Home with fetch Source: https://github.com/adguardteam/adguardhome/blob/master/README.md Use this command with fetch to automate the installation of AdGuard Home on systems where fetch is available. The -v flag enables verbose output. ```shell fetch -o - https://raw.githubusercontent.com/AdguardTeam/AdGuardHome/master/scripts/install.sh | sh -s -- -v ``` -------------------------------- ### Install Backend Dependencies Source: https://github.com/adguardteam/adguardhome/blob/master/scripts/README.md Installs the necessary backend dependencies for AdGuard Home. Optional environment variables include GO for specifying the Go compiler and VERBOSE for controlling output. ```shell # Example: Install dependencies using a specific Go version GO=go1.21 ./make/go-deps.sh ``` -------------------------------- ### Run Twosky Translation Help Source: https://github.com/adguardteam/adguardhome/blob/master/scripts/README.md Prints the usage instructions for the Twosky translation script. No setup is required beyond having the script available. ```bash go run ./scripts/translations help ``` -------------------------------- ### API: Get filtering status Source: https://github.com/adguardteam/adguardhome/blob/master/AGHTechDoc.md Example JSON response for the GET /control/filtering/status API endpoint. ```json { "enabled": true | false "interval": 0 | 1 | 12 | 1*24 || 3*24 || 7*24 "filters":[ { "id":1 "enabled":true, "url":"https://...", "name":"...", "rules_count":1234, "last_updated":"2019-09-04T18:29:30+00:00", } ... ], "whitelist_filters":[ { "id":1 "enabled":true, "url":"https://...", "name":"...", "rules_count":1234, "last_updated":"2019-09-04T18:29:30+00:00", } ... ], "user_rules":["...", ...] } ``` -------------------------------- ### Block example.org for multiple clients Source: https://github.com/adguardteam/adguardhome/wiki/Hosts-Blocklists Example demonstrating how to specify multiple clients in one rule. ```adblock ||example.org^$client=~Mom|~Dad|Kids ``` -------------------------------- ### Prepare Release Build Source: https://github.com/adguardteam/adguardhome/blob/master/README.md Use the make build-release command to prepare a release build. Specify the channel and version for the release. ```sh make build-release CHANNEL='...' VERSION='...' ``` -------------------------------- ### API: Get TLS configuration response Source: https://github.com/adguardteam/adguardhome/blob/master/AGHTechDoc.md Example JSON response for the 'Get TLS configuration' API endpoint. ```json { "enabled":true, "server_name":"...", "port_https":443, "port_dns_over_tls":853, "port_dns_over_quic":784, "certificate_chain":"...", "private_key":"...", "certificate_path":"...", "private_key_path":"..." "subject":"CN=...", "issuer":"CN=...", "not_before":"2019-03-19T08:23:45Z", "not_after":"2029-03-16T08:23:45Z", "dns_names":null, "key_type":"RSA", "valid_cert":true, "valid_key":true, "valid_chain":false, "valid_pair":true, "warning_validation":"Your certificate does not verify: x509: certificate signed by unknown authority" } ``` -------------------------------- ### Command-line update Source: https://github.com/adguardteam/adguardhome/wiki/Getting-Started Command to update AdGuard Home package from the command line. ```shell ./AdGuardHome --update ``` -------------------------------- ### Example Rewrites Configuration Source: https://github.com/adguardteam/adguardhome/wiki/Configuration This example shows how to configure legacy DNS rewrites, specifying domains and their corresponding answers or special values like 'A' for A records. ```yaml 'rewrites': - 'domain': example.com 'answer': 127.0.0.1 - 'domain': '*.example.com' 'answer': A ``` -------------------------------- ### API: Domain Check Source: https://github.com/adguardteam/adguardhome/blob/master/AGHTechDoc.md Example JSON response for the GET /control/filtering/check_host API endpoint. ```json { "reason":"FilteredBlackList", "rules":{ "filter_list_id":42, "text":"||doubleclick.net^", }, // If we have "reason":"FilteredBlockedService". "service_name": "...", // If we have "reason":"Rewrite". "cname": "...", "ip_addrs": ["1.2.3.4", ...] } ``` -------------------------------- ### Get List of Clients Response Source: https://github.com/adguardteam/adguardhome/blob/master/AGHTechDoc.md Example JSON response for retrieving the list of clients. ```json { clients: [ { name: "client1" ids: ["...", ...] tags: ["...", ...] use_global_settings: true filtering_enabled: false parental_enabled: false safebrowsing_enabled: false safesearch_enabled: false use_global_blocked_services: true blocked_services: [ "name1", ... ] whois_info: { key: "value" ... } upstreams: ["upstream1", ...] } ] auto_clients: [ { name: "host" ip: "..." source: "etc/hosts" || "rDNS" whois_info: { key: "value" ... } } ] supported_tags: ["...", ...] } ``` -------------------------------- ### Expected output for verification Source: https://github.com/adguardteam/adguardhome/wiki/VPS The expected output when the AdGuard Home service is working correctly. ```none Using domain server: Name: 127.0.0.1 Address: 127.0.0.1#53 Aliases: Host doubleclick.net not found: 3(NXDOMAIN) ``` -------------------------------- ### Clone and Build AdGuard Home Source: https://github.com/adguardteam/adguardhome/blob/master/README.md Clone the AdGuard Home repository and build the project using the make command. Ensure you have Go and Node.js installed. ```sh git clone https://github.com/AdguardTeam/AdGuardHome cd AdGuardHome make ``` -------------------------------- ### Run Backend Benchmarks Source: https://github.com/adguardteam/adguardhome/blob/master/scripts/README.md Executes backend benchmarks for AdGuard Home. Optional environment variables include GO for specifying the Go compiler and TIMEOUT_FLAGS for test timeouts. VERBOSE controls the output level. ```shell # Example usage with custom timeout and verbosity GO=go1.21 TIMEOUT_FLAGS="--timeout=60s" VERBOSE=1 ./make/go-bench.sh ``` -------------------------------- ### Get Query Log Parameters Response Source: https://github.com/adguardteam/adguardhome/blob/master/AGHTechDoc.md Example response for retrieving current query log configuration parameters. ```json { "enabled": true | false "interval": 1 | 7 | 30 | 90 "anonymize_client_ip": true | false } ``` -------------------------------- ### Get Raspberry Pi IP Address Source: https://github.com/adguardteam/adguardhome/wiki/Raspberry-Pi Command to retrieve the IP address of the Raspberry Pi. ```shell hostname -I | xargs -n 1 ``` -------------------------------- ### Granting Capabilities on Linux Source: https://github.com/adguardteam/adguardhome/wiki/Getting-Started This command allows AdGuard Home to listen on port 53 without superuser privileges on Linux systems. ```bash sudo setcap 'CAP_NET_BIND_SERVICE=+eip CAP_NET_RAW=+eip' ./AdGuardHome ``` -------------------------------- ### Create Docker Buildx Builder Source: https://github.com/adguardteam/adguardhome/blob/master/README.md Create and select a Docker Buildx builder instance named 'buildx-builder' using the Docker container driver. ```sh docker buildx create --name buildx-builder --driver docker-container --use ``` -------------------------------- ### Get Query Log Response Source: https://github.com/adguardteam/adguardhome/blob/master/AGHTechDoc.md Example response structure for the query log, including oldest entry timestamp and a list of log data. ```json { "oldest":"2006-01-02T15:04:05.999999999Z07:00" "data":[ { "answer":[ { "ttl":10, "type":"AAAA", "value":"::" } ... ], "original_answer": [ // Answer from upstream server (optional) { "type":"AAAA", "value":"::" } ... ], "upstream":"...", // Upstream URL starting with tcp://, tls://, https://, or with an IP address "answer_dnssec": true, "client":"127.0.0.1", "client_proto": "" (plain) | "doh" | "dot" | "doq", "elapsedMs":"0.098403", "filterId":1, "question":{ "class":"IN", "host":"doubleclick.net", "type":"AAAA" }, "reason":"FilteredBlackList", "rule":"||doubleclick.net^", "service_name": "...", // set if reason=FilteredBlockedService "status":"NOERROR", "time":"2006-01-02T15:04:05.999999999Z07:00" } ... ] } ``` -------------------------------- ### Get Query Log Request Source: https://github.com/adguardteam/adguardhome/blob/master/AGHTechDoc.md Example request for retrieving query log entries, with parameters for pagination, search, and response status filtering. ```http GET /control/querylog ?older_than=2006-01-02T15:04:05.999999999Z07:00 &search=... &response_status="..." ``` -------------------------------- ### Block example.org for multiple clients with exclusion Source: https://github.com/adguardteam/adguardhome/wiki/Hosts-Blocklists Example of blocking 'example.org' for everyone except specific clients, demonstrating comma escaping. ```adblock ||example.org^$client=~'Mary\'s\, John\'s\, and Boris\'s laptops' ``` -------------------------------- ### Get Version Command - Request and Responses Source: https://github.com/adguardteam/adguardhome/blob/master/AGHTechDoc.md This snippet shows the request to check for a new version and example responses, including when auto-update is disabled. ```http POST /control/version.json { "recheck_now": true | false // if false, server will check for a new version data only once in several hours } ``` ```http 200 OK { "new_version": "v0.95", "announcement": "AdGuard Home v0.95 is now available!", "announcement_url": "http://...", "can_autoupdate": true } ``` ```http 200 OK { "disabled":true } ``` -------------------------------- ### Changing DNS Listen Port in AdGuardHome.yaml Source: https://github.com/adguardteam/adguardhome/wiki/Getting-Started Configuration snippet to change the DNS listen port in the AdGuardHome.yaml file to avoid requiring superuser privileges. ```yaml dns: port: 53 ``` -------------------------------- ### Block example.org for a specific client name Source: https://github.com/adguardteam/adguardhome/wiki/Hosts-Blocklists Example of blocking 'example.org' for a client named 'Frank's laptop', demonstrating quote escaping. ```adblock ||example.org^$client='Frank\'s laptop' ``` -------------------------------- ### Upstream DNS Server Configuration Examples Source: https://github.com/adguardteam/adguardhome/wiki/Configuration Examples demonstrating how to configure upstream DNS servers with specific routing rules for different domains and subdomains. ```none 8.8.8.8:53 [/host.com/]1.1.1.1:53 [/*.host.com/]2.2.2.2:53 ``` ```none 8.8.8.8:53 [/host.com/]1.1.1.1:53 2.2.2.2:53 ``` -------------------------------- ### Install AdGuard Home Edge Version Source: https://github.com/adguardteam/adguardhome/blob/master/README.md Use this script to install the latest edge version of AdGuard Home from the development branch. Ensure you have curl installed. ```sh curl -s -S -L https://raw.githubusercontent.com/AdguardTeam/AdGuardHome/master/scripts/install.sh | sh -s -- -c edge ``` -------------------------------- ### Example: Local Domains and Default Upstreams Source: https://github.com/adguardteam/adguardhome/wiki/Configuration Configuration example sending queries for *.local domains to a specific upstream and others to a default. ```none 8.8.8.8:53 [/local/]192.168.0.1:53 ``` -------------------------------- ### Install AdGuard Home with curl Source: https://github.com/adguardteam/adguardhome/blob/master/README.md Use this command to automatically download and install AdGuard Home on Linux, Unix, MacOS, FreeBSD, and OpenBSD systems. The -v flag enables verbose output. ```shell curl -s -S -L https://raw.githubusercontent.com/AdguardTeam/AdGuardHome/master/scripts/install.sh | sh -s -- -v ``` -------------------------------- ### Example: Domain Precedence and Default Upstreams Source: https://github.com/adguardteam/adguardhome/wiki/Configuration Configuration example showing domain precedence and the use of '#' for default upstreams. ```none 8.8.8.8:53 [/host.com/]1.1.1.1:53 [/maps.host.com/]# ``` -------------------------------- ### Example DNSCrypt Stamp Source: https://github.com/adguardteam/adguardhome/wiki/DNSCrypt An example of a generated DNSCrypt stamp. ```none sdns://AQcAAAAAAAAADTEyNy4wLjAuMTo0NDMg8R3bzEgX5UOEX93Uy4gYSbZCJvPeOXYlZp2HuRm8T7AbMi5kbnNjcnlwdC1jZXJ0LmV4YW1wbGUub3Jn ``` -------------------------------- ### Redirect response example Source: https://github.com/adguardteam/adguardhome/blob/master/AGHTechDoc.md Example of a redirect response when not authenticated. ```http 302 Found Location: /login.html ``` -------------------------------- ### Build the Backend Source: https://github.com/adguardteam/adguardhome/blob/master/scripts/README.md Compiles the AdGuard Home backend. Supports various environment variables for build customization, including GOAMD64, GOARM, GOMIPS, GO, OUT, PARALLELISM, SOURCE_DATE_EPOCH, VERBOSE, and VERSION. Requires CHANNEL. ```shell # Example: Build with specific output name and parallelism OUT=adguardhome-custom PARALLELISM=4 VERBOSE=1 ./make/go-build.sh ``` -------------------------------- ### Install htpasswd on Fedora Source: https://github.com/adguardteam/adguardhome/wiki/Configuration Command to install the htpasswd utility on Fedora systems. ```sh sudo dnf install httpd-tools ```