Hello.
The problem is double curly braces in
policy.FORWARD({{'192.168.0.126'}})
For one address it is possible to use without curly braces and for
multiple addresses use single curly braces.
policy.FORWARD('192.168.0.126')
policy.FORWARD({'192.168.0.126', '192.168.0.127'})
Then it should work.
Aleš M.
On 12/12/23 18:14, martin.skalicky(a)outlook.cz wrote:
Hi!
I'm pretty new to Knot Resolver, previously i used Bind9 but wanted to try something
else.
However, i can't really figure out one problem, error:
[system] error while loading config: /usr/lib/knot-resolver/kres_modules/policy.lua:43:
bad argument #1 to 'kr_straddr_split' (cannot convert 'table' to
'const char *') (workdir '/var/lib/knot-resolver')
I don't absolutely know, what am I doing wrong.
Can you help me, please? Also, possible communication in Czech if better for someone?
Here is my kresd.conf (my actual domains are replaced by domain1.tld, domain2.tld
respectively):
-- SPDX-License-Identifier: CC0-1.0
-- vim:syntax=lua:set ts=4 sw=4:
-- Refer to manual:
https://knot-resolver.readthedocs.org/en/stable/
-- Network interface configuration
net.listen('127.0.0.1', 53, { kind = 'dns' })
net.listen('127.0.0.1', 853, { kind = 'tls' })
net.listen('::1', 53, { kind = 'dns', freebind = true })
net.listen('::1', 853, { kind = 'tls', freebind = true })
-- Load useful modules
modules = {
'hints > iterate', -- Allow loading /etc/hosts or custom root hints
'stats', -- Track internal statistics
'predict', -- Prefetch expiring/frequent records
}
-- Cache size
cache.size = 100 * MB
-- DNS Rebinding Configuration
policy.add(policy.todnames({'domain2.tld', 'domain1.tld'}),
policy.PASS)
policy.add(policy.todnames({'domain2.tld', 'domain1.tld'}),
policy.FORWARD({{'192.168.0.126'}}))
--
--
Ales Mrazek
PGP: 3057 EE9A 448F 362D 7420 5A77 9AB1 20DA 0A76 F6DE