Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion config/dnsmasq.conf
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ CONFIG_PACKAGE_dnsmasq_full_conntrack=y
CONFIG_PACKAGE_dnsmasq_full_noid=y
# CONFIG_PACKAGE_dnsmasq_full_broken_rtc is not set
CONFIG_PACKAGE_dnsmasq_full_tftp=y
CONFIG_PACKAGE_https-dns-proxy=m
CONFIG_PACKAGE_https-dns-proxy=y
30 changes: 20 additions & 10 deletions docs/design/doh.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,28 @@ parent: Design

# DoH (DNS over HTTPS)

You can provide the standard DHCP instance with a forward to DNS-over-HTTPs (DOH) servers.
This is done by using the [`https-dns-proxy`](https://openwrt.org/docs/guide-user/services/dns/doh_dnsmasq_https-dns-proxy).
You can provide the standard DHCP instance with a forward to DNS-over-HTTPS (DoH) servers.
This is done by using the [`https-dns-proxy`](https://openwrt.org/docs/guide-user/services/dns/doh_dnsmasq_https-dns-proxy), which is included in the NethSecurity image.

The package can be installed using the following command:
By default:

- the service is disabled and is not started on boot
- the proxy listens on `127.0.0.1:5053` and `127.0.0.1:5054` when started
- `option dnsmasq_config_update '-'` prevents automatic `dnsmasq` changes

The configuration is stored in `/etc/config/https-dns-proxy`. Upstream options are documented at
[docs.openwrt.melmac.ca/https-dns-proxy](https://docs.openwrt.melmac.ca/https-dns-proxy/).

To integrate the proxy with `dnsmasq`, choose the `dnsmasq_config_update` value you want and then enable the service:

```bash
apk update
apk add https-dns-proxy
uci set https-dns-proxy.config.dnsmasq_config_update='*'
uci commit https-dns-proxy
/etc/init.d/https-dns-proxy enable
/etc/init.d/https-dns-proxy start
```

By default, the proxy listens to the `127.0.0.1:5053` and `127.0.0.1:5054` addresses. The configuration for the service can be found at the
following [link](https://docs.openwrt.melmac.net/https-dns-proxy).

The tool will edit the dnsmasq configuration automatically, takes care of keeping it up to date, and restart the
services if any changes happen.
If `dnsmasq_config_update` stays set to `-`, the first-boot defaults script
will consider the service disabled and may disable it again after an image
upgrade. At the moment this is not expected to be a practical problem because
configuration is supported only from the command line.
12 changes: 12 additions & 0 deletions files/etc/uci-defaults/99-nethsec-https-dns-proxy
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/sh

#
# Copyright (C) 2026 Nethesis S.r.l.
# SPDX-License-Identifier: GPL-2.0-only
#

if [ "$(uci -q get https-dns-proxy.config.dnsmasq_config_update)" = "-" ]; then
/etc/init.d/https-dns-proxy disable
fi

exit 0
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
diff --git a/net/https-dns-proxy/files/etc/config/https-dns-proxy b/net/https-dns-proxy/files/etc/config/https-dns-proxy
index 2aa9b210c..9c7e67d91 100644
--- a/net/https-dns-proxy/files/etc/config/https-dns-proxy
+++ b/net/https-dns-proxy/files/etc/config/https-dns-proxy
@@ -4 +4 @@ config main 'config'
- option dnsmasq_config_update '*'
+ option dnsmasq_config_update '-'
Loading