From 9a094485407985d42be7be4d54727f5c6e6e5a7b Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Wed, 13 Oct 2021 11:57:26 +0200 Subject: [PATCH] libnetwork: ServeDNS(): don't panic on unsupported query types This was added in b3c883bb2f560fc935315102983092438f76be25, but resulted in a panic if the embedded DNS had to handle an unsupported query-type, such as ANY. This patch adds a debug log for this case (to better describe how it's handled. Signed-off-by: Sebastiaan van Stijn --- libnetwork/resolver.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libnetwork/resolver.go b/libnetwork/resolver.go index 71a2f2045d..7a53ee9e33 100644 --- a/libnetwork/resolver.go +++ b/libnetwork/resolver.go @@ -384,7 +384,8 @@ func (r *resolver) ServeDNS(w dns.ResponseWriter, query *dns.Msg) { case dns.TypeSRV: resp, err = r.handleSRVQuery(name, query) default: - panic("error") + queryType := dns.TypeToString[query.Question[0].Qtype] + logrus.Debugf("[resolver] query type %s is not supported by the embedded DNS and will be forwarded to external DNS", queryType) } if err != nil {