diff --git a/tests-extra/tools/dnstest/params.py b/tests-extra/tools/dnstest/params.py
index f1c1de898816c876c2c0099bacb4e186551e2cc7..3fc5aefeef47a6ee5142cf35ddf2a83faae6010b 100644
--- a/tests-extra/tools/dnstest/params.py
+++ b/tests-extra/tools/dnstest/params.py
@@ -8,10 +8,11 @@ import os, shutil
 
 module_path = os.path.dirname(os.path.realpath(__file__))
 repo_path = os.path.realpath(os.path.join(module_path, "..", "..", ".."))
+build_path = os.environ.get("KNOT_TEST_BUILD_PATH", repo_path)
 
 def repo_binary(name):
     """Get absolute path to a binary in Knot DNS sources."""
-    return os.path.join(repo_path, name)
+    return os.path.join(build_path, name)
 
 def get_binary(env_name, default):
     env = os.environ.get(env_name)