-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
50 lines (35 loc) · 1.1 KB
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package main
import (
"log"
config "github.com/micro/go-config"
"github.com/miekg/dns"
)
//MyDNS is my dns server
var MyDNS *dns.Server
//MyConf is the config file
var MyConf config.Config
//ZabovUpDNS keeps the name of upstream DNSs
var ZabovUpDNS string
//ZabovSingleBL list of urls returning a file with just names of domains
var ZabovSingleBL string
//ZabovDoubleBL list of urls returning a file with IP<space>domain
var ZabovDoubleBL string
//ZabovAddBL is the IP we want to send all the clients to. Usually is 127.0.0.1
var ZabovAddBL string
//ZabovCacheTTL is the amount of hours we cache records of DNS
var ZabovCacheTTL int
//ZabovKillTTL is the amount of hours we cache the killfile
var ZabovKillTTL int
//ZabovHostsFile is the file we use to keep our hosts
var ZabovHostsFile string
//ZabovDNSArray is the array containing all the DNS we mention
var ZabovDNSArray []string
type handler struct{}
func main() {
MyDNS.Handler = &handler{}
if err := MyDNS.ListenAndServe(); err != nil {
log.Printf("Failed to set udp listener %s\n", err.Error())
} else {
log.Printf("Listener running \n")
}
}