pull/18/head
Hugo Landau 10 years ago
parent 53ab040fdc
commit cc5afd43b7

@ -1,4 +1,5 @@
package backend package backend
import "github.com/golang/groupcache/lru" import "github.com/golang/groupcache/lru"
import "github.com/miekg/dns" import "github.com/miekg/dns"
import "github.com/hlandau/degoutils/log" import "github.com/hlandau/degoutils/log"
@ -260,7 +261,7 @@ func (tx *btx) doRootDomain() (rrs []dns.RR, err error) {
Ns: dns.Fqdn(nsname), Ns: dns.Fqdn(nsname),
} }
rrs = []dns.RR{ soa, ns, } rrs = []dns.RR{soa, ns}
return return
} }
@ -383,7 +384,7 @@ func (tx *btx) addAnswersUnderNCValueActual(ncv *ncValue, sn string) (rrs []dns.
continue continue
} }
rrs = append(rrs, &dns.A{ rrs = append(rrs, &dns.A{
Hdr: dns.RR_Header { Name: dns.Fqdn(tx.qname), Rrtype: dns.TypeA, Class: dns.ClassINET, Ttl: 600, }, Hdr: dns.RR_Header{Name: dns.Fqdn(tx.qname), Rrtype: dns.TypeA, Class: dns.ClassINET, Ttl: 600},
A: pip}) A: pip})
} }
@ -399,7 +400,7 @@ func (tx *btx) addAnswersUnderNCValueActual(ncv *ncValue, sn string) (rrs []dns.
continue continue
} }
rrs = append(rrs, &dns.AAAA{ rrs = append(rrs, &dns.AAAA{
Hdr: dns.RR_Header { Name: dns.Fqdn(tx.qname), Rrtype: dns.TypeAAAA, Class: dns.ClassINET, Ttl: 600, }, Hdr: dns.RR_Header{Name: dns.Fqdn(tx.qname), Rrtype: dns.TypeAAAA, Class: dns.ClassINET, Ttl: 600},
AAAA: pip}) AAAA: pip})
} }
@ -412,7 +413,7 @@ func (tx *btx) addAnswersUnderNCValueActual(ncv *ncValue, sn string) (rrs []dns.
for _, ns := range nss { for _, ns := range nss {
ns = dns.Fqdn(ns) ns = dns.Fqdn(ns)
rrs = append(rrs, &dns.NS{ rrs = append(rrs, &dns.NS{
Hdr: dns.RR_Header { Name: dns.Fqdn(tx.qname), Rrtype: dns.TypeNS, Class: dns.ClassINET, Ttl: 600, }, Hdr: dns.RR_Header{Name: dns.Fqdn(tx.qname), Rrtype: dns.TypeNS, Class: dns.ClassINET, Ttl: 600},
Ns: ns}) Ns: ns})
} }
@ -424,7 +425,7 @@ func (tx *btx) addAnswersUnderNCValueActual(ncv *ncValue, sn string) (rrs []dns.
for _, txt := range txts { for _, txt := range txts {
rrs = append(rrs, &dns.TXT{ rrs = append(rrs, &dns.TXT{
Hdr: dns.RR_Header { Name: dns.Fqdn(tx.qname), Rrtype: dns.TypeTXT, Class: dns.ClassINET, Ttl: 600, }, Hdr: dns.RR_Header{Name: dns.Fqdn(tx.qname), Rrtype: dns.TypeTXT, Class: dns.ClassINET, Ttl: 600},
Txt: txt}) Txt: txt})
} }
@ -569,7 +570,7 @@ func (ncv *ncValue) GetDSs() (dss []dns.DS, err error) {
a4h := hex.EncodeToString(a4b) a4h := hex.EncodeToString(a4b)
d := dns.DS{ d := dns.DS{
Hdr: dns.RR_Header { Rrtype: dns.TypeDS, Class: dns.ClassINET, Ttl: 60, }, Hdr: dns.RR_Header{Rrtype: dns.TypeDS, Class: dns.ClassINET, Ttl: 60},
KeyTag: uint16(a1), KeyTag: uint16(a1),
Algorithm: uint8(a2), Algorithm: uint8(a2),
DigestType: uint8(a3), DigestType: uint8(a3),

@ -1,4 +1,5 @@
package main package main
import "github.com/hlandau/degoutils/config" import "github.com/hlandau/degoutils/config"
import "github.com/hlandau/degoutils/log" import "github.com/hlandau/degoutils/log"
import "github.com/hlandau/degoutils/daemon" import "github.com/hlandau/degoutils/daemon"
@ -8,7 +9,7 @@ func main() {
cfg := server.ServerConfig{} cfg := server.ServerConfig{}
config := config.Configurator{ config := config.Configurator{
ProgramName: "ncdns", ProgramName: "ncdns",
ConfigFilePaths: []string { "etc/ncdns.conf", "/etc/ncdns/ncdns.conf", }, ConfigFilePaths: []string{"etc/ncdns.conf", "/etc/ncdns/ncdns.conf"},
} }
config.ParseFatal(&cfg) config.ParseFatal(&cfg)

@ -1,4 +1,5 @@
package server package server
import "github.com/hlandau/madns" import "github.com/hlandau/madns"
import "github.com/hlandau/degoutils/log" import "github.com/hlandau/degoutils/log"
import "github.com/hlandau/ncdns/backend" import "github.com/hlandau/ncdns/backend"

@ -1,4 +1,5 @@
package util package util
import "strings" import "strings"
// Split a domain name a.b.c.d.e into parts a (the head) and b.c.d.e (the rest). // Split a domain name a.b.c.d.e into parts a (the head) and b.c.d.e (the rest).

Loading…
Cancel
Save