I’m trying to setup a selective DNS forwarding rule for kresd to resolve my tailscale DNS names (foo.ts.net) over the tailscale DNS server (100.100.100.100). Just in case, tailscale is working properly on the router and the router clients can reach out the rest of the tailscale hosts via IP, but I wanted to add the ability to reach them via hostname.
After reading Knot resolver (i.e. kresd) - DNS advanced settings for Omnia and MOX [Turris wiki] I’ve created the custom.conf file as:
policy.add(policy.suffix(policy.FORWARD('100.100.100.100'), {todname('foo.ts.net.')}))
But after a resolver restart it doesn’t work. I think it is because the “DNS Forwarding” setup on Reforis DNS - Turris Documentation takes precedence over the custom one as the generated kresd.config file looks like:
--Automatically generated file; DO NOT EDIT
modules = {
'hints > iterate'
, 'policy'
, 'stats'
, predict = { window = 0, period = 0 }
}
hints.use_nodata(true)
policy.add(policy.rpz(policy.DENY, '/etc/kresd/adb_list.overall'))
hints.config('/tmp/kresd/hints.tmp')
net.listen('0.0.0.0', 53, { kind = 'dns' })
net.listen('0.0.0.0', 853, { kind = 'tls' })
net.listen('::', 53, { kind = 'dns' })
net.listen('::', 853, { kind = 'tls' })
trust_anchors.remove('.')
trust_anchors.add_file('/etc/root.keys', true)
net.bufsize(1232)
net.ipv4=true
net.ipv6=false
cache.open(20*MB)
cache.clear()
table.insert(policy.special_names, { count = 0, cb = policy.all(
policy.TLS_FORWARD(
{{'1.1.1.1'
,hostname='cloudflare-dns.com'
,ca_file='/etc/ssl/certs/ca-certificates.crt'
},{'1.0.0.1'
,hostname='cloudflare-dns.com'
,ca_file='/etc/ssl/certs/ca-certificates.crt'
}}))})
--- Included custom configuration file from: ---
--- /etc/kresd/custom.conf
policy.add(policy.suffix(policy.FORWARD('100.100.100.100'), {todname('foo.ts.net.')}))
user('kresd','kresd')
Do I need to inject the policy.add stuff before the DNS Forwarding?If that’s so… how?
I’ve also tried this Kresd custom DNS forwarding rule before "Use forwarding" rule - #2 by dpdrown approach but it still doesn’t work.
Any hints?
Thanks!