rrda

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

commit b7690cba8ed25c4c2c57ed58120c7c300e2329a7
parent d177ecca9c660b7386553ee6ff25133b0a780412
Author: Frederic Cambus <fcambus@users.sourceforge.net>
Date:   Wed,  9 Oct 2013 00:35:01 +0200

Documentation update

Diffstat:
MREADME.md | 3++-
Mrrda.go | 4++--
2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/README.md b/README.md @@ -46,7 +46,8 @@ The following examples assume there is a resolver on localhost listening on port URL Scheme : http://server:port/resolver:port/domain/querytype -- Example : http://127.0.0.1:8080/127.0.0.1:53/example.org/ns +- Example (using an IPv4 resolver) : http://127.0.0.1:8080/127.0.0.1:53/example.org/ns +- Example (using an IPv6 resolver) : http://127.0.0.1:8080/[::1]:53/example.org/ns ### Getting Reverse PTR Records (for both IPv4 and IPv6 addresses) diff --git a/rrda.go b/rrda.go @@ -4,7 +4,7 @@ /* http://www.statdns.com */ /* */ /* Created: 2012/03/11 */ -/* Last Updated: 2013/07/01 */ +/* Last Updated: 2013/10/09 */ /* */ /* RRDA is released under the BSD 3-Clause license. */ /* See LICENSE file for details. */ @@ -126,7 +126,7 @@ func query(w http.ResponseWriter, r *http.Request) { domain := dns.Fqdn(r.URL.Query().Get(":domain")) querytype := r.URL.Query().Get(":querytype") - if domain, err := idna.ToASCII(domain); err == nil { // ValidateValid IP address (IPv4 or IPv6) + 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, server, domain, querytype)