Overwrite Nameserver (STUB?)
Hi,
(IPs, hostnames and domains are fictional, but realistic.)
Description
my goal is to setup a local nameserver (knot, the machine is known as vanadium, IP 192.168.5.3) and a local kresd (on machine palstek, 192.168.5.2) to use this nameserver for any local-domains (example.org). So, for a request www.example.org, kresd should use vanadium as nameserver, instead of the public nameserver (a.iana-servers.net..., 199.43.135.53...). The differences to #349 is, nameserver instead of hints.
My first try was to use policy.STUB: policy.add( policy.suffix( policy.STUB( "192.168.5.2"), {todname('example.org.')}))
But vanadium is a non-recursive server, but STUB expects a recursive. So troja CNAME www.heise.de.
on vanadium, will be unresolved; kresd will not follow this CNAME. A local CNAME lieschen CNAME mueller
works fine.
We have problems with some clients, which expects an A-record, not a CNAME. I would expect, that a recursive DNS-Server should follow the CNAME and it does it, if it is a not the example.org.-zone.
Configs for STUB-example
Zone
$TTL 60
@ SOA vanadium.example.org root.example.org ( 2018121103 28800 14400 3600000 86400 )
NS vanadium
A 192.168.5.12
troja CNAME www.heise.de.
mueller A 192.168.5.24
lieschen CNAME mueller
kresd.conf
user( 'knot-resolver','knot-resolver')
cache.size = 1*GB
modules = { 'policy', 'stats', 'predict' }
verbose(true)
predict.config(20, 72)
policy.add( policy.all( policy.QTRACE))
policy.add( policy.suffix( policy.STUB( "10.91.53.3"), {
todname('example.org.')
}))
Tests for STUB-example
Simple A-Record, no problems:
# dig mueller.example.org
;; ANSWER SECTION:
mueller.example.org. 60 IN A 192.168.5.24
CNAME, the non-recursive-Server already followes the record:
# dig lieschen.example.org
;; ANSWER SECTION:
lieschen.example.org. 60 IN CNAME mueller.example.org.
mueller.example.org. 60 IN A 192.168.5.24
The unfollowed CNAME-record:
# dig troja.example.org
troja.example.org. 60 IN CNAME www.heise.de.
I had expect as answer also the A-Record www.heise.de. 86400 IN A 193.99.144.85
So, STUB seems not to be the correct solution for my goal. Also the description of stub-dns is different to my goal.
- But how I can overwrite the Nameserver of my domain in kresd.conf?
- Or how it is possible to use STUB, but kresd tries to follow CNAMES, if A-record was not provided?
BR Denis