Skip to content

Commit

Permalink
Support _status query on pgeodns tld zone
Browse files Browse the repository at this point in the history
  • Loading branch information
abh committed Aug 28, 2012
1 parent 65f42ec commit c1ad24b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
10 changes: 10 additions & 0 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,16 @@ func configReadDir(dirName string, Zones Zones) {
}
}

func setupPgeodnsZone(Zones Zones) {
zoneName := "pgeodns"
Zone := new(Zone)
Zone.Labels = make(labels)
Zone.Origin = zoneName
Zone.LenLabels = dns.LenLabels(Zone.Origin)
Zones[zoneName] = Zone
dns.HandleFunc(zoneName, setupServerFunc(Zone))
}

func readZoneFile(zoneName, fileName string) (*Zone, error) {
defer func() {
if err := recover(); err != nil {
Expand Down
3 changes: 2 additions & 1 deletion geodns.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ func main() {

Zones := make(Zones)

setupPgeodnsZone(Zones)

go configReader(dirName, Zones)
go listenAndServe(&Zones)

Expand All @@ -42,5 +44,4 @@ func main() {
log.Printf("geodns: signal received, stopping")
os.Exit(0)
}

}

0 comments on commit c1ad24b

Please sign in to comment.