Skip to content

Personal DNS and AdGuard Home

Why run your own DNS server?

DNS (Domain Name System) translates website names into IP addresses. Normally, a device sends these queries to the network's DNS provider. With AdGuard Home, you can manage them on your own VPS: see your devices' requests, block advertising and tracking domains, create custom rules and choose upstream DNS resolvers.

3X-UI AUTO NGINX installs AdGuard Home and integrates it with the existing nginx configuration. Your DNS gets a secure HTTPS address on the panel domain, and you manage it through a separate web panel. No additional domain is required.

Two distinct DNS features in the installer

Feature What it serves When it is enabled
Encrypted DNS for the VPS itself Global server DNS queries via systemd-resolved When you enable enhanced VPS security
AdGuard Home Phones, computers and other devices you connect to it Through a separate installer prompt

The first feature protects the global DNS queries of the VPS itself. The second provides personal DNS with filtering and a query log. Installing AdGuard Home does not automatically switch DNS for the VPS, Xray or client apps to it. To use filtering on a phone or computer, configure personal DNS on the device or in the app.

Choose how to connect:

If 3X-UI AUTO NGINX is already installed without AdGuard Home, do not run Installation again just to add DNS: it replaces managed data. There is no separate built-in menu option for adding AdGuard Home to an existing stack. If you decide to deploy the project again, save a Backup outside the VPS beforehand.

Part 1. Connect using DoH

This option is suitable for devices and apps that support DNS-over-HTTPS. You can distinguish devices and allow queries only from your own clients.

Step 1. Obtain the DoH address

If you have a new VPS, follow the getting started guide. Answer Y to Install and configure AdGuard Home? and N to Enable DNS-over-TLS (DoT) for your devices? if you do not need DoT.

After installation, save the AdGuard Home panel address, username and password. If the project is already installed with AdGuard Home enabled, download and launch the latest manager, then choose 6. My server details.

Example addresses (do not copy them literally):

  • Panel: https://panel.example.com/adg-.../
  • DoH: https://panel.example.com/dns-XXXXXXXXXXXX

The project does not expose port 53 to the internet. DoH uses nginx and the existing HTTPS panel domain. Open the AdGuard Home panel address and sign in.

Step 2. Configure ClientID if needed

New installations already have an individual randomized DoH path such as /dns-XXXXXXXXXXXX. For ordinary personal use, this address is sufficient if no allowed-client list is configured. Do not publish it: a randomized path makes guessing more difficult but is not full authentication.

ClientID is a device identifier added to the DoH address. It is useful if you want to distinguish devices in the query log, assign individual rules or restrict access through an allowed-client list. We especially recommend ClientID for older installations with a shared predictable /dns-query path.

If you do not need ClientID and the allowed-client list is empty, skip to step 3.

If you also use DoT

Before saving the allowed-client list, add 127.0.0.1 to it as well; otherwise DoT will stop responding. This allows public DoT queries. If you only use DoH, you do not need to add the local address.

  1. In AdGuard Home, create a persistent client for each device and assign it a long, individual ClientID.
  2. Go to Settings → DNS settings → Access settings → Allowed clients.
  3. Add the required ClientIDs, retain existing entries needed by other clients and, if you use DoT, add 127.0.0.1. Save the settings. DoH queries without a matching identifier will be rejected unless their source is allowed by another rule.

Official AdGuard instructions: persistent clients and ClientID and running securely.

Step 3. Connect your device and verify DoH

DoH sends DNS queries over HTTPS. In your device or app settings, select a custom DoH server and paste the address obtained in step 1:

https://panel.example.com/dns-XXXXXXXXXXXX

If you configured a ClientID in step 2, append it to your address:

https://panel.example.com/dns-XXXXXXXXXXXX/ClientID

These are examples. Use your own full URL from the server manager, including its path.

Example: configure personal DNS in Happ

On a phone running Happ with an ordinary RAW subscription (connection links, not JSON):

  1. Open your subscription's routing settings and active profile. If there is no profile, create one based on the default profile.
  2. In Remote DNS, choose the DoH type. Paste the full personal DNS URL into Remote DNS Domain and enter the public IP of the VPS that the DoH domain points to in Remote DNS IP. Keep the existing routing rules.
  3. If you want to use your own DNS for destinations accessed directly under the profile's rules, configure Domestic DNS the same way: DoH, the same URL and IP. This is optional.
  4. Save the profile, enable routing for the subscription, disconnect and reconnect. Changes take effect when you reconnect.

Names may differ depending on the app version. For JSON subscriptions, Happ uses separate Tunnel DNS fields, while Xray routing and DNS settings are determined by the received JSON. Configuring Tunnel DNS alone does not replace the DNS configuration inside the JSON. A RAW subscription is therefore simpler for this example. Happ routing and DNS documentation.

Verify the result

Open a few websites on the device, then view the Query log in the AdGuard Home panel. New queries should appear. If you configured ClientID, check that the queries are associated with the expected client. If no entries appear, check the address, access rules, active DNS profile and whether you reconnected. Some apps may use their own DNS.

Done: queries sent to your personal DNS appear in the log. You can now configure filtering if you wish.

Part 2. Android Private DNS over DoT

Android provides a system-wide Private DNS setting. It accepts a hostname rather than an HTTPS URL.

DoT is publicly accessible

In our setup, TCP/853 is open to the internet; anyone who knows the server address can send DNS queries. Requests reach AdGuard Home from 127.0.0.1 through nginx, so ClientID and individual device rules do not work. Choose DoH if you need individual access restrictions.

Step 1. Prepare DoT on the VPS

During the first installation using the guide, answer Y to Install and configure AdGuard Home? and Y to Enable DNS-over-TLS (DoT) for your devices?. If the hosting provider filters ports separately, allow TCP/853 in its control panel.

If the project is already installed with DoT, no reinstallation is required: use the panel domain. If DoT was not enabled, stop: there is no separate built-in menu option to add it. Do not reinstall a working project just for DoT; use DoH instead if AdGuard Home is already enabled.

Save the AdGuard Home panel address and login details, and open the panel. On an existing installation, you can find the address under 6. My server details.

Step 2. Check allowed clients

In AdGuard Home, open Settings → DNS settings → Access settings → Allowed clients. If the list is already in use, it must contain 127.0.0.1; otherwise DoT queries will be rejected. If no list is configured, no separate DoT setting is needed. Adding the local address allows queries from all devices that connect to the public DoT endpoint.

Step 3. Configure Android

  1. Open the network settings and find Private DNS (the exact name depends on your Android interface).
  2. Choose the option to enter a provider hostname.
  3. Enter the panel domain, for example panel.example.com, without https://, a path or a port.
  4. Save the setting and open a website. The AdGuard Home Query log should show queries from 127.0.0.1. If not, check the domain, TCP/853 reachability and allowed-client list.

Done: Android uses your personal DNS over an encrypted channel. You can now configure filtering if you wish.

Using DoH and DoT together

To use both methods, enable AdGuard Home and DoT during a fresh installation. If the project already includes both, you do not need to reinstall anything.

  1. Follow the DoH setup. If you enable the allowed-client list, retain the required ClientIDs and add 127.0.0.1 for DoT. If the list is empty, no separate configuration is needed.
  2. Follow the Android DoT setup.
  3. Check queries from both types of devices in the AdGuard Home log.

Without the local address, DoT stops responding when an allowed-client list is active. With it, DoT remains available to anyone who knows the server address.

Configure filtering and logging

  1. Open the provided AdGuard Home panel address and sign in using the saved credentials.
  2. In the DNS filters section, choose suitable blocklists. You can change or disable lists.
  3. Review the domains requested in the query log. If a useful service stops working, inspect its requests and allow the relevant domain if necessary.
  4. If needed, configure different rules for the persistent clients you created during DoH setup.

DNS filtering blocks queries to known advertising and tracking domains. It also lets you manage your own DNS rules. Ads served from a website's own domain may remain; this is a limitation of DNS-based filtering.

How to disable external DoT access

If you no longer need DoT, first switch Android to another DNS provider, then connect to the VPS via SSH and obtain root privileges. Check the current firewall rules:

ufw status numbered

If UFW is active and has the standard allow rule for 853/tcp, delete it on the VPS as root:

ufw delete allow 853/tcp

Check the rules and external port reachability again. If UFW is inactive or configured differently, restrict TCP/853 using the hosting provider's firewall or the active firewall rules. DoH will continue working through TCP/443. Do not change SSH or other allow rules.

How to update AdGuard Home

On recent installations, version checks and native AdGuard Home updates are available in its web panel. First create a Backup v3 and save it outside the VPS. If the interface offers an update, run it there, then test panel login, DNS and DoH on your device. The project does not update AdGuard Home on a schedule.

For older installations with updates disabled, there is a separate guide to re-enabling updates with a pinned release and checksum verification. Do not run Installation to update AdGuard Home.

How settings are preserved

An already configured AdGuard Home installation is retained during an in-place project update. AdGuard Home, its configuration, filters and data are included in a full Backup v3. Full Restore to a compatible VPS restores them along with the managed stack. When the panel domain changes, the project accounts for the optional DoT certificate.

Backup and Restore · Enhanced VPS security · Getting started

Attribution and use of materials

© 2026 xPROMSx contributors · 3X-UI AUTO NGINX

Our material may be copied and distributed under the GNU GPL-3.0-only license, provided the attribution and link to the original are retained.

Original source: https://xpromsx.github.io/3x-ui-auto-nginx/guides/dns/

Terms of use for project materials