diff options
author | 2023-07-31 16:34:31 -0300 | |
---|---|---|
committer | 2023-07-31 15:34:31 -0400 | |
commit | cc7a36463325c8cdb7864c879f20a8259df4e4c3 (patch) | |
tree | ee125e857d184ded64abe721d5f258dd3a1739ee /plugin | |
parent | b7c9d3e155418cb1dccc6de50e4fddce6137d3cb (diff) | |
download | coredns-cc7a36463325c8cdb7864c879f20a8259df4e4c3.tar.gz coredns-cc7a36463325c8cdb7864c879f20a8259df4e4c3.tar.zst coredns-cc7a36463325c8cdb7864c879f20a8259df4e4c3.zip |
[RFC-9250]: Add QUIC server support (#6182)
Add DNS-over-QUIC server
Signed-off-by: jaehnri <joao.henri.cr@gmail.com>
Signed-off-by: João Henri <joao.henri.cr@gmail.com>
Diffstat (limited to 'plugin')
-rw-r--r-- | plugin/metrics/README.md | 1 | ||||
-rw-r--r-- | plugin/metrics/vars/vars.go | 7 | ||||
-rw-r--r-- | plugin/pkg/parse/host.go | 2 | ||||
-rw-r--r-- | plugin/pkg/parse/transport.go | 4 | ||||
-rw-r--r-- | plugin/pkg/transport/transport.go | 3 |
5 files changed, 17 insertions, 0 deletions
diff --git a/plugin/metrics/README.md b/plugin/metrics/README.md index ec5da10d0..144a5d1c6 100644 --- a/plugin/metrics/README.md +++ b/plugin/metrics/README.md @@ -21,6 +21,7 @@ the following metrics are exported: * `coredns_dns_response_size_bytes{server, zone, view, proto}` - response size in bytes. * `coredns_dns_responses_total{server, zone, view, rcode, plugin}` - response per zone, rcode and plugin. * `coredns_dns_https_responses_total{server, status}` - responses per server and http status code. +* `coredns_dns_quic_responses_total{server, status}` - responses per server and QUIC application code. * `coredns_plugin_enabled{server, zone, view, name}` - indicates whether a plugin is enabled on per server, zone and view basis. Almost each counter has a label `zone` which is the zonename used for the request/response. diff --git a/plugin/metrics/vars/vars.go b/plugin/metrics/vars/vars.go index f0cf829c9..6de75c044 100644 --- a/plugin/metrics/vars/vars.go +++ b/plugin/metrics/vars/vars.go @@ -72,6 +72,13 @@ var ( Name: "https_responses_total", Help: "Counter of DoH responses per server and http status code.", }, []string{"server", "status"}) + + QUICResponsesCount = promauto.NewCounterVec(prometheus.CounterOpts{ + Namespace: plugin.Namespace, + Subsystem: subsystem, + Name: "quic_responses_total", + Help: "Counter of DoQ responses per server and QUIC application code.", + }, []string{"server", "status"}) ) const ( diff --git a/plugin/pkg/parse/host.go b/plugin/pkg/parse/host.go index c396dc853..f90e4fc77 100644 --- a/plugin/pkg/parse/host.go +++ b/plugin/pkg/parse/host.go @@ -61,6 +61,8 @@ func HostPortOrFile(s ...string) ([]string, error) { ss = net.JoinHostPort(host, transport.Port) case transport.TLS: ss = transport.TLS + "://" + net.JoinHostPort(host, transport.TLSPort) + case transport.QUIC: + ss = transport.QUIC + "://" + net.JoinHostPort(host, transport.QUICPort) case transport.GRPC: ss = transport.GRPC + "://" + net.JoinHostPort(host, transport.GRPCPort) case transport.HTTPS: diff --git a/plugin/pkg/parse/transport.go b/plugin/pkg/parse/transport.go index 0da640856..f0cf1c249 100644 --- a/plugin/pkg/parse/transport.go +++ b/plugin/pkg/parse/transport.go @@ -19,6 +19,10 @@ func Transport(s string) (trans string, addr string) { s = s[len(transport.DNS+"://"):] return transport.DNS, s + case strings.HasPrefix(s, transport.QUIC+"://"): + s = s[len(transport.QUIC+"://"):] + return transport.QUIC, s + case strings.HasPrefix(s, transport.GRPC+"://"): s = s[len(transport.GRPC+"://"):] return transport.GRPC, s diff --git a/plugin/pkg/transport/transport.go b/plugin/pkg/transport/transport.go index e23b6d647..cdb2c79b7 100644 --- a/plugin/pkg/transport/transport.go +++ b/plugin/pkg/transport/transport.go @@ -4,6 +4,7 @@ package transport const ( DNS = "dns" TLS = "tls" + QUIC = "quic" GRPC = "grpc" HTTPS = "https" UNIX = "unix" @@ -15,6 +16,8 @@ const ( Port = "53" // TLSPort is the default port for DNS-over-TLS. TLSPort = "853" + // QUICPort is the default port for DNS-over-QUIC. + QUICPort = "853" // GRPCPort is the default port for DNS-over-gRPC. GRPCPort = "443" // HTTPSPort is the default port for DNS-over-HTTPS. |