Skip to content

Commit 7b5811a

Browse files
committed
dnsmasq: prevent upstream resolution of addresses
`list address` entries in /etc/config/dhcp are sometimes (I'm not sure about the exact conditions) passed to upstream resolver, bypassing local resolution. Adding them (minus the IP) to --local prevents this. In the configuration, this means that # /etc/config/dhcp list address '/hello.com/world.com/1.2.3.4' list address '/foo.com/bar.com/4.3.2.1' which previously translated into # /var/etc/dnsmasq.conf.* address=/hello.com/world.com/1.2.3.4 address=/foo.com/bar.com/4.3.2.1 now becomes # /var/etc/dnsmasq.conf.* address=/hello.com/world.com/1.2.3.4 local=/hello.com/world.com/ address=/foo.com/bar.com/4.3.2.1 local=/foo.com/bar.com/ This behaviour is controlled by the `address_as_local` boolean option, which defaults to false (old behaviour). openwrt/luci#7957 adds support for this flag to LuCI. A workaround for a small list of domains is to add them to `option local`, but this is very tedious to do for every `list address` entry and dnsmasq limits this option to 1024 characters. Signed-off-by: Marko Zajc <[email protected]>
1 parent 9aca8a9 commit 7b5811a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

package/network/services/dnsmasq/files/dnsmasq.init

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ append_rev_server() {
171171

172172
append_address() {
173173
xappend "--address=$1"
174+
xappend "--local=${1%/*}/"
174175
}
175176

176177
append_connmark_allowlist() {

0 commit comments

Comments
 (0)