CoreDNS402

16402
D© Internet Initiative Japan Inc.

1

CoreDNS

2

CoreDNSCoreDNSDNS ••••

CoreDNS$'27* Plugin6 &%.427 Plugin-)
PluginChain(/Plugin+#27
CoreDNSGo0  $%Plugin- 3/

5 file plugin + dnssec plugin

3/File Plugin"!
89,27
Dnssec plugin
9,1273Plugin4CoreDNS – Plugin - file

file plugin
RFC1035
RFC1035

     $GENERATE, $INCLUDE 

Corefile
example.jp. {file example.jp.zone}
example.jp.zone$ORIGIN example.jp$TTL 3600@ IN SOA ns1 root 1 3600 600 604800 900@ IN NS localhost$GENERATE 1-255 sv$ IN A 192.168.0.$$INCLUDE hoeghoge.zone
5CoreDNS – Plugin - file

file plugin
DNSSEC   NSECNSEC3$ dig @localhost example.jp soa +dnssec;; ANSWER SECTION:example.jp.
3600 IN
SOA g000.d-53.net. dns-managers.iij.ad.jp. 1 3600 600 86400 30
example.jp.
3600 INRRSIG SOA 13 2 3600 20210723010411 ($ dig @localhost empty.example.jp soa +dnssec;; AUTHORITY SECTION:example.jp.
3600 IN
SOA g000.d-53.net. dns-managers.iij.ad.jp. 1 3600 600 86400 30
example.jp.
3600 INRRSIG SOA 13 2 3600 20210723010411 20210623010411 (example.jp.
30
IN
NSEC example.jp. NS SOA RRSIG NSEC DNSKEY
example.jp.
30
IN
RRSIG NSEC 13 2 30 20210723010411 20210623010411 (6CoreDNS – Plugin - forward

template plugin!

Corefile
example.jp {template IN AAAA {answer "{{ .Name }} 30 IN AAAA 2001:db8::53"}}$ dig @localhost a.example.jp. aaaa +short
2001:240::54$ dig @localhost b.example.jp. aaaa +short
2001:240::54• %AAAA  #2001:db8::53$• &    "10CoreDNS – Plugin - forwarddnssec plugin RRSIG,NSEC#

Corefile
example.jp {template IN TXT {answer "{{ .Name }} 30 IN AAAA 2001:db8::53"}
dnssec {key file Kexample.jp.zone.+013+33664}}• 
template• & ZSK,KSKCSK• !"$ NSEC(black lie) "$%
11CoreDNS – Plugin - forward

prometheus pluginprometheus

Corefile
example.jp {prometheus :9153}$ curl http://localhost:9153/metrics
coredns_dns_requests_total{family="1",proto="udp",server="dns://:53",type="A",zone="example.jp."} 1000
coredns_dns_responses_total{rcode="NOERROR",server="dns://:53",zone=”example.jp."} 1000
…"• Exporterprometheus metrics!
12CoreDNS











• .7#"/;  ,• Chain plugin30 /; 42&(• 8• !9+• 1-6:5 $)'%*"

13CoreDNSIIJ DNS

CoreDNS14CoreDNS@IIJ DNS(DPF)

Primary DNS
6AE5NSD

Backend&+)-

K<:

-(write)

DB

read

CoreDNS
CoreDNS(master)(Primary)

-BC

Knot

• ->92D%,'Primary$104F8• DB*!E5; DB(#1047J • PrimaryDB?H -"!L=
• 6APrimary DNS  CoreDNS+G/PluginI3.
15

CoreDNS,IIJ DNS(DPF)

Primary DNS
$&(2019)0%

NSD

Backend

3('DB(write)

readPowerDNSPowerDNS-/Knot$&*1DB 4).+5! # PowerDNS2"16

CoreDNS# 1 Parser• +!dnssec-signzone(bind9)  • PowerDNS ", RFC3597'$&*
%

+!

dnssec-signzone

BIND", +! DB)(PowerDNS17

CoreDNS# 1 Parser• +!dnssec-signzone(bind9)  • PowerDNS ", RFC3597'$&*
%

DB)(&*+!

dnssec-signzone

BIND", +! 

PowerDNS",  PowerDNS+! 

18

CoreDNSL 2 

• PowerDNSPowerDNS1N XFAJV= •XFD'$ "-+(W@T0 3
• @MI:R,#)PowerDNS HC
• /8,#)dnssec-sinzoneXF6P .9
• dnssec-signzone4O?*&% KU>• ;2GIssue  !L5Q7  



BIND9S[ZBEPowerDNSDBL =Y  <!
19

20

CoreDNS – IIJ?9I

DPFDNS
• 7DPF B>;,0("JE:D @
DNS#* GoC(miekg/dns-$)• CNAME FlattenDNS#*• k8s-api8K notifyPodFHDNS#*• Notify = Webhook#*• etc…
• miekg/dnsCoreDNSC14 =>6 .!+./• transfer plugin&0FH5GDB )'%$J3Plugin

C<L



transfer pluginA27M
21

PowerDNS&.!%

1 Parser
• 4"dnssec-signzone(bind9)bindraw(binary) • raw0* DB2 pluginraw0*6#,3' • raw0* GoDNS5Parser/1
2 

• dnssec-sinezone$(    %
• +-    +do bit),3522

CoreDNS – IIJ:3=• ;3 9B21'(++0• prometheusmetrics goroutine9@F/  D6C(goroutine Leek)7• transfer plugin$?8 •  <4.&-"!profileEA5#*%, )#• >CoreDNSGo23

CoreDNS – IIJ*%5• CoreDNSPlugin+ 0&•*% Plugin02 ,.3)• metrics( profile #!-%3)'/79• "4DNS
$68124



25