01Two gaps
A single resolver is a single point of failure: if it stops, no name resolves on the network any more. And away from home, the phone uses the mobile carrier’s DNS, unfiltered and in clear text.
02A second resolver, outside the house
An Oracle Cloud VPS hosts a secondary AdGuard Home with the same filter lists as the primary. DHCP hands both servers to the local network, which reaches the VPS through an encrypted tunnel: its port 53 is only reachable that way.
A detail that matters: DNS server order is not a guarantee, some systems query either one freely. Hence identical lists on both sides: filtering must not depend on which server answers.
03On 4G: encrypted DNS
The phone sends all its queries to the VPS, encrypted with DNS-over-HTTPS on port 443 (configuration profile on iOS, browser setting elsewhere). A hardened nginx sits in front: TLS 1.2 and 1.3 only, rate limiting, and silent dropping of scan requests. The VPS presents a Let’s Encrypt certificate for its name.
On Android, “Private DNS” uses DNS-over-TLS (port 853). In strict mode, if the server stops answering, the device has no DNS at all: it does not fall back to clear text. Monitoring the VPS therefore matters.
# DNS-over-HTTPS (iOS profile, browser)
https://dns.example.com/dns-query
# Android · Settings › Network › Private DNS (DNS-over-TLS, port 853)
dns.example.com04Going further: serving only your devices
An encrypted resolver open to everyone is still an open resolver. AdGuard Home can recognise a device by a ClientID: the end of the path in DNS-over-HTTPS (/dns-query/phone), or the first label of the name in DNS-over-TLS (phone.dns.example.com). With an allowed-clients list, any query without a known ClientID is refused.
In DNS-over-TLS, the ClientID requires a wildcard certificate (*.dns.example.com), obtained through the DNS-01 challenge.
dns:
allowed_clients:
- phone # the phone's ClientID
- 10.66.0.0/24 # the tunnel network back home
tls:
enabled: true
server_name: dns.example.com
port_dns_over_tls: 853
port_https: 44305Open the bare minimum
From the Internet, only 443 (DNS-over-HTTPS), 80 (certificate renewal) and SSH answer, the latter on a separate port restricted to the home address. Plain DNS and DNS-over-TLS are only reachable through the tunnel. Plain DNS open to the whole Internet would become an “open resolver”, usable for amplification attacks.
Classic Oracle Cloud trap: two layers filter traffic, the VCN network rules (security list or NSG) and the OS firewall, whose Ubuntu images ship with iptables rules that reject everything else. A port must be opened in both, otherwise it stays closed.
# 1. VCN ingress rules: TCP 443 (DoH) and TCP 80 (certificate)
# 2. OS firewall (Oracle's Ubuntu images)
sudo iptables -I INPUT -p tcp --dport 443 -m state --state NEW -j ACCEPT
sudo iptables -I INPUT -p tcp --dport 80 -m state --state NEW -j ACCEPT
sudo iptables -I INPUT -i wg0 -j ACCEPT # everything from the tunnel (DNS 53, DoT 853)
sudo netfilter-persistent save
# Ports 53 and 853: never open to the whole Internet06Verify
Three tests are enough: stop the home AdGuard and check that names still resolve; on 4G, open the VPS query log and watch the phone’s queries arrive; finally, from an outside connection, check that the VPS’s ports 53 and 853 do not answer.
Key takeaways
- Two resolvers, same lists: same filtering, whichever answers.
- On 4G: DoH on 443 to the VPS, behind a hardened nginx.
- Plain DNS and DoT: through the tunnel only.
- Oracle Cloud: open a port in the VCN and in the OS.
- Never plain DNS open to the world.
Example domain and addresses.
Official sources
- AdGuard Home: configurationgithub.com/AdguardTeam/AdGuardHome/wiki/Configuration
- AdGuard Home: clients and ClientIDadguard-dns.io/kb/adguard-home/clients/
- Android: DNS-over-TLS support in Android Pandroid-developers.googleblog.com/2018/04/dns-over-tls-support-in-android-p.html
- Oracle Cloud: security listsdocs.oracle.com/en-us/iaas/Content/Network/Concepts/securitylists.htm