rrda

REST API allowing to perform DNS queries over HTTP
Log | Files | Refs | README | LICENSE

commit cbcf10aa882cd5e6854105135e3059e020dca55b
parent fd9848ecbd4ff64d11bf50eaf681c99731d7ab7d
Author: Frederic Cambus <fred@statdns.com>
Date:   Tue, 10 Jan 2023 12:34:34 +0100

Pass dns.ClassINET when resolving from the 'ptr' and 'query' endpoint.

Diffstat:
Mrrda.go | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/rrda.go b/rrda.go @@ -147,7 +147,7 @@ func query(w http.ResponseWriter, r *http.Request) { if domain, err := idna.ToASCII(domain); err == nil { // Valid domain name (ASCII or IDN) if _, isDomain := dns.IsDomainName(domain); isDomain { // Well-formed domain name if querytype, ok := dns.StringToType[strings.ToUpper(querytype)]; ok { // Valid DNS query type - resolve(w, r, server, domain, querytype) + resolve(w, r, server, domain, querytype, dns.ClassINET) } else { error(w, 400, 404, "Invalid DNS query type") } @@ -165,7 +165,7 @@ func ptr(w http.ResponseWriter, r *http.Request) { ip := chi.URLParam(r, "ip") if arpa, err := dns.ReverseAddr(ip); err == nil { // Valid IP address (IPv4 or IPv6) - resolve(w, r, server, arpa, dns.TypePTR) + resolve(w, r, server, arpa, dns.TypePTR, dns.ClassINET) } else { error(w, 400, 403, "Input string is not a valid IP address") }