fix(coredns): fixes in coredns installer and client

This commit is contained in:
2025-02-12 16:24:58 +02:00
parent 3117d288b1
commit 25c997fec5
6 changed files with 250 additions and 296 deletions

View File

@@ -9,38 +9,52 @@ mut installer := coredns_installer.get()!
// coredns_installer.fix()!
installer.start()!
// TODO: create heroscript and run it to add dns records
mut script := '
mut script := "
!!dns.a_record
name: "host1"
ip: "1.1.1.1"
sub_domain: 'host1'
ip: '1.2.3.4'
ttl: 300
!!dns.aaaa_record
name: "host2"
ip: "2001:db8::1"
sub_domain: 'host1'
ip: '2001:db8::1'
ttl: 300
!!dns.mx_record
host: "mail.heroexample.com"
sub_domain: '*'
host: 'mail.example.com'
preference: 10
ttl: 300
!!dns.txt_record
text: "v=spf1 mx ~all"
sub_domain: '*'
text: 'v=spf1 mx ~all'
ttl: 300
!!dns.srv_record
target: "sip.heroexample.com"
service: 'ssh'
protocol: 'tcp'
host: 'host1'
target: 'sip.example.com'
port: 5060
priority: 10
weight: 100
ttl: 300
!!dns.ns_record
host: "ns1.heroexample.com"
host: 'ns1.example.com'
ttl: 300
'
!!dns.soa_record
mbox: 'hostmaster.example.com'
ns: 'ns1.example.com'
refresh: 44
retry: 55
expire: 66
minttl: 100
ttl: 300
"
mut plbook := playbook.new(text: script)!
rec := coredns.play_dns(mut plbook)!
rec.set('heroexample.com')!
mut set := coredns.play_dns(mut plbook)!
set.set(key_prefix: 'dns:', domain: 'heroexample.com')!