|
|
@@ -22,7 +22,7 @@ func (FakeDNSServer) Name() string {
|
|
|
return "FakeDNS"
|
|
|
}
|
|
|
|
|
|
-func (f *FakeDNSServer) QueryIP(ctx context.Context, domain string, _ net.IP, _ dns.IPOption, _ bool) ([]net.IP, error) {
|
|
|
+func (f *FakeDNSServer) QueryIP(ctx context.Context, domain string, _ net.IP, opt dns.IPOption, _ bool) ([]net.IP, error) {
|
|
|
if f.fakeDNSEngine == nil {
|
|
|
if err := core.RequireFeatures(ctx, func(fd dns.FakeDNSEngine) {
|
|
|
f.fakeDNSEngine = fd
|
|
|
@@ -30,7 +30,12 @@ func (f *FakeDNSServer) QueryIP(ctx context.Context, domain string, _ net.IP, _
|
|
|
return nil, newError("Unable to locate a fake DNS Engine").Base(err).AtError()
|
|
|
}
|
|
|
}
|
|
|
- ips := f.fakeDNSEngine.GetFakeIPForDomain(domain)
|
|
|
+ var ips []net.Address
|
|
|
+ if fkr0, ok := f.fakeDNSEngine.(dns.FakeDNSEngineRev0); ok {
|
|
|
+ ips = fkr0.GetFakeIPForDomain3(domain, opt.IPv4Enable, opt.IPv6Enable)
|
|
|
+ } else {
|
|
|
+ ips = f.fakeDNSEngine.GetFakeIPForDomain(domain)
|
|
|
+ }
|
|
|
|
|
|
netIP, err := toNetIP(ips)
|
|
|
if err != nil {
|