Fix: the priority of fake-ip-filter
This commit is contained in:
parent
d5ac0df372
commit
0da177c3af
1 changed files with 5 additions and 5 deletions
|
@ -102,6 +102,11 @@ func withFakeIP(fakePool *fakeip.Pool) middleware {
|
|||
return func(r *D.Msg) (*D.Msg, error) {
|
||||
q := r.Question[0]
|
||||
|
||||
host := strings.TrimRight(q.Name, ".")
|
||||
if fakePool.LookupHost(host) {
|
||||
return next(r)
|
||||
}
|
||||
|
||||
if q.Qtype == D.TypeAAAA {
|
||||
msg := &D.Msg{}
|
||||
msg.Answer = []D.RR{}
|
||||
|
@ -115,11 +120,6 @@ func withFakeIP(fakePool *fakeip.Pool) middleware {
|
|||
return next(r)
|
||||
}
|
||||
|
||||
host := strings.TrimRight(q.Name, ".")
|
||||
if fakePool.LookupHost(host) {
|
||||
return next(r)
|
||||
}
|
||||
|
||||
rr := &D.A{}
|
||||
rr.Hdr = D.RR_Header{Name: q.Name, Rrtype: D.TypeA, Class: D.ClassINET, Ttl: dnsDefaultTTL}
|
||||
ip := fakePool.Lookup(host)
|
||||
|
|
Loading…
Reference in a new issue