]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
knot-resolver: Don't overwrite zone apexes
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 9 Jul 2026 10:07:57 +0000 (12:07 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 9 Jul 2026 10:32:12 +0000 (10:32 +0000)
For SafeSearch we want to ensure that there are no leaks, but it is for
obvious reasons nonsensical to overwrite the apex.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
config/knot-resolver/config.lua

index c382434c2b07903b2b3b3879af3cd84e6f03d392..c3fb6ef2506ce594ed9d248461be7a26078fcbe4 100644 (file)
@@ -329,24 +329,22 @@ function config.load_safesearch(settings)
 
        -- Enable Googe Safe Search
        for i, tld in ipairs(GOOGLE_TLDS) do
-               local name = string.format("google.%s", tld)
-
-               add({ name, "www." .. name}, "forcesafesearch.google.com")
+               add({ string.format("www.google.%s", tld) }, "forcesafesearch.google.com")
        end
 
        -- Enable Bing Strict Search
-       add({ "bing.com", "www.bing.com" }, "strict.bing.com")
+       add({ "www.bing.com" }, "strict.bing.com")
 
        -- Enable DuckDuckGo Safe Search
-       add({ "duckduckgo.com", "www.duckduckgo.com" }, "safe.duckduckgo.com")
+       add({ "www.duckduckgo.com" }, "safe.duckduckgo.com")
 
        -- Enable Yandex Family Search
-       add({ "yandex.com", "www.yandex.com" }, "familysearch.yandex.com")
-       add({ "yandex.ru", "www.yandex.ru" }, "familysearch.yandex.ru")
+       add({ "www.yandex.com" }, "familysearch.yandex.com")
+       add({ "www.yandex.ru" }, "familysearch.yandex.ru")
 
        -- Enable YouTube Safe Search
        if settings["ENABLE_SAFE_SEARCH_YOUTUBE"] == "on" then
-               add({ "youtube.com", "www.youtube.com" }, "restrictmoderate.youtube.com")
+               add({ "www.youtube.com" }, "restrictmoderate.youtube.com")
        end
 
        -- Create a new zone