Skip to content
Sign inDashboard

OpenWrt

https-dns-proxy runs on the router and listens locally. It sends every query from dnsmasq to opdns over DNS-over-HTTPS. opdns then filters every device on the network, and you do not have to change the devices.

  1. Install the package and its LuCI page. Connect to the router with SSH, or use System → Software in LuCI:

    Terminal window
    opkg update
    opkg install https-dns-proxy luci-app-https-dns-proxy
  2. Replace the default resolvers with opdns. You can do this in LuCI or in the configuration file. In LuCI, open Services → HTTPS DNS Proxy, choose a custom provider, and paste the URL. In the configuration file, use these settings:

    /etc/config/https-dns-proxy
    config main 'config'
    option update_dnsmasq_config '*'
    option force_dns '1'
    config https-dns-proxy
    option resolver_url 'https://dns.opdns.net/<profile-id>/<device>'
    option listen_addr '127.0.0.1'
    option listen_port '5053'

    Use a device name for the router, for example openwrt. Delete all other config https-dns-proxy sections. If you keep them, the queries are shared between them.

  3. Restart the service:

    Terminal window
    /etc/init.d/https-dns-proxy restart

    The package points dnsmasq at the local proxy by itself (update_dnsmasq_config). force_dns sends LAN devices that hard-code a different DNS server back to the router.

  4. Check that it works. The queries from every device appear under the device name of the router.

  • The whole network has one device name. The router makes the queries, so every LAN device appears as the router. If you want a name for each LAN client, you need a forwarder that names each client, for example the opdns CLI on a router. Otherwise, also set up encrypted DNS on each device.
  • At start, https-dns-proxy resolves dns.opdns.net one time through its bootstrap servers (set with option bootstrap_dns). Bootstrap servers are the servers that it uses before DoH works. These lookups are plain DNS to the listed servers.
  • Browsers with their own DoH bypass the router. Firefox obeys the canary domain (a name that tells Firefox to turn off its own DoH), and a force_dns setup can block that domain. Chrome follows the system.