aboutsummaryrefslogtreecommitdiff
path: root/httpd.go
diff options
context:
space:
mode:
authorShulhan <m.shulhan@gmail.com>2020-09-02 23:11:38 +0700
committerShulhan <m.shulhan@gmail.com>2020-09-02 23:11:38 +0700
commit33a650f64b60ff9f350b847cc076e8822feabffb (patch)
tree00fc52d7619b3ba7d666eb70c25363677849c9ca /httpd.go
parent18711e43c2f53643ff7a758d258c6d7b28340c70 (diff)
downloadrescached-33a650f64b60ff9f350b847cc076e8822feabffb.tar.xz
all: handle saving the PTR record on Zone file editor
Diffstat (limited to 'httpd.go')
-rw-r--r--httpd.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/httpd.go b/httpd.go
index 24ad440..2360a4b 100644
--- a/httpd.go
+++ b/httpd.go
@@ -651,6 +651,13 @@ func (srv *Server) apiMasterFileCreateRR(
rr.Name += "." + masterFileName
}
+ // Reverse the value and name for PTR record.
+ if rr.Type == dns.QueryTypePTR {
+ tmp := rr.Name
+ rr.Name = rr.Value.(string)
+ rr.Value = tmp
+ }
+
listRR := []*dns.ResourceRecord{&rr}
err = srv.dns.PopulateCachesByRR(listRR, mf.Path)
if err != nil {