mirror of
https://github.com/nadoo/glider.git
synced 2026-11-19 07:09:42 +08:00
dns: 1. support cache; 2. support custom records; #35
This commit is contained in:
1 parent
a2a67df771
commit
a226637bfb
6 files changed
+210
-58
No files matched your search
@@ -57,11 +57,16 @@ func main() {
|
||||
dialer := NewRuleDialer(conf.rules, dialerFromConf())
|
||||
ipsetM, _ := NewIPSetManager(conf.IPSet, conf.rules)
|
||||
if conf.DNS != "" {
|
||||
d, err := dns.NewServer(conf.DNS, dialer, conf.DNSServer...)
|
||||
d, err := dns.NewServer(conf.DNS, dialer, conf.DNSServer)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
// custom records
|
||||
for _, record := range conf.DNSRecord {
|
||||
d.AddRecord(record)
|
||||
}
|
||||
|
||||
// rule
|
||||
for _, r := range conf.rules {
|
||||
for _, domain := range r.Domain {
|
||||
|
||||
Reference in new issue
Block a user