/images/avatar.png

░E░r░i░c░ ░V░l░o░g░

Adguard Home Dns on Debian Armbian

Guide to Change DNS for AdGuard Home (192.168.1.5) on Debian/Armbian and Apply to Docker 🐋

Step 1: Configure AdGuard Home DNS Settings 🌐

  1. Access AdGuard Home Dashboard:

    • Open a web browser and go to:
      http://192.168.1.5:3000
  2. Log in to your account.

  3. Navigate to DNS Settings:

    • Go to Settings > DNS settings.
  4. Configure DNS Forwarding:

    • Add public DNS servers (if needed), e.g.,
      • Primary: 8.8.8.8 (Google)
      • Secondary: 1.1.1.1 (Cloudflare)
  5. Save your changes.

Step 2: Change DNS on Debian/Armbian 🖥️

Method 1: Edit /etc/resolv.conf

  1. Open Terminal.
  2. Edit the resolv.conf file:
    sudo nano /etc/resolv.conf
    
  3. Add the following line:
    nameserver 192.168.1.5
    
  4. Save and exit:
    Press CTRL + X, then Y, and hit Enter.

Method 2: Using /etc/network/interfaces:

If using /etc/network/interfaces:

  1. Open Terminal.
  2. Edit the interfaces file:
    sudo nano /etc/network/interfaces
    
  3. Add or modify the DNS setting:
    dns-nameservers 192.168.1.5
    
  4. Save and exit.
  5. Restart networking service:
    sudo systemctl restart networking
    

Step 3: Configure Docker to Use AdGuard Home DNS 🐳

  1. Edit Docker daemon configuration:

    sudo nano /etc/docker/daemon.json
    
  2. Add or modify the following line if you have changed the Docker default folder before:

    {
      "data-root": "/mnt/docker",
      "dns": ["192.168.1.5"]
    }
    
    • Make sure to include the "dns" setting if you want to configure DNS as well.
    • The "data-root": "/mnt/docker" specifies the location where you changed the Docker data directory.
  3. Save and exit:
    Press CTRL + X, then Y, and hit Enter.

    If docker have

  4. Restart Docker:

    sudo systemctl restart docker
    

Step 4: Verify DNS Settings in Docker Containers ✅

  1. Run a test container:
    docker run --rm busybox nslookup google.com
    
  2. Check the output:
    Ensure it shows 192.168.1.5 as the DNS server.

Conclusion 🎉

You have successfully changed the DNS settings for AdGuard Home and applied them to your Debian/Armbian system and Docker! Now enjoy enhanced ad-blocking and DNS filtering!

Guide to Moving the Default /var/lib/docker to Another Directory on Linux

📦 Guide to Moving the Default /var/lib/docker to Another Directory on Linux 1. 🚫 Stop the Docker Service First, stop the Docker service: sudo systemctl stop docker If you see a warning like this: Warning: Stopping docker.service, but it can still be activated by: docker.socket Then stop the Docker socket as well: sudo systemctl stop docker.socket To ensure that the Docker daemon is completely stopped, you can run: docker ps -a If the command does not return any running containers, the daemon is stopped.

Speeding Up Docker Image Pulls with Multiple Registry Mirrors

🚀 Speeding Up Docker Image Pulls with Multiple Registry Mirrors

Docker image pulls can sometimes be slow due to network issues or high demand on the Docker Hub. One effective way to speed up these pulls is by using multiple registry mirrors. This tutorial will guide you through the process of configuring Docker to use multiple registry mirrors.

🛠️ Prerequisites

  • A running Docker installation on your system.
  • Sudo privileges to edit Docker configuration files.

📄 Step-by-Step Guide

1. Open the Docker Daemon Configuration File

First, you need to open the Docker daemon configuration file. This file is typically located at /etc/docker/daemon.json.

sudo nano /etc/docker/daemon.json

2. Add Multiple Registry Mirrors

If the file is empty, you can start by adding the basic JSON structure. Here’s an example configuration with multiple registry mirrors:

{
  "registry-mirrors": [
    "https://mirror.gcr.io",
    "https://registry-1.docker.io",
    "https://mirror.aliyuncs.com"
  ],
  "dns": ["8.8.8.8", "8.8.4.4"],
  "max-concurrent-downloads": 10,
  "log-driver": "json-file",
  "log-opts": {
    "max-size": "10m",
    "max-file": "3"
  }
}

Explanation:

  • registry-mirrors: Lists the registry mirrors Docker will use. Docker will try each mirror in the order listed until it finds one that works.
  • dns: Sets custom DNS servers for Docker containers.
  • max-concurrent-downloads: Limits the number of concurrent downloads to improve performance.
  • log-driver: Sets the logging driver (e.g., json-file).
  • log-opts: Configures options for the logging driver, such as maximum log size and the number of log files to retain.

3. Save the Configuration File

After adding the configuration, save the file and exit the editor.

  • Press Ctrl + O to save the changes.
  • Press Enter to confirm the file name.
  • Press Ctrl + X to exit the nano editor.

4. Restart Docker

To apply the changes, you need to restart the Docker service.

sudo systemctl restart docker

5. Verify the Configuration

You can verify that the configuration has been applied by running:

docker info

Check the output to ensure that the registry mirrors are listed under the Registry Mirrors section.

✅ Conclusion

By adding multiple registry mirrors, you can significantly improve the speed and reliability of Docker image pulls. This is especially useful in environments with varying network conditions or high demand on the Docker Hub.

Rclone Automount on Linux

Automatically Mounting rclone Remote Directory on Debian 11 (pikpak) To automatically mount the remote directory using rclone on system restart in Debian 11, you can create a systemd service unit. Here’s how you can do it: Create a systemd service unit file: Open a terminal and create a new service unit file using your favorite text editor. For example: sudo nano /etc/systemd/system/rclone-mount.service Add the following content to the file: [Unit] Description=RClone Mount Service After=network-online.