Merge pull request #570 from projectdiscovery/bugfix-dns-fallback-support

Adding dns fallback support
dev
PD-Team 2021-02-24 19:05:00 +05:30 committed by GitHub
commit 41a9ed8f86
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 10 additions and 6 deletions

View File

@ -26,12 +26,12 @@ require (
github.com/pkg/errors v0.9.1
github.com/projectdiscovery/clistats v0.0.7
github.com/projectdiscovery/collaborator v0.0.2
github.com/projectdiscovery/fastdialer v0.0.6
github.com/projectdiscovery/fastdialer v0.0.7-0.20210224113953-30d7daf807bc
github.com/projectdiscovery/goflags v0.0.2
github.com/projectdiscovery/gologger v1.1.3
github.com/projectdiscovery/hmap v0.0.1
github.com/projectdiscovery/rawhttp v0.0.6
github.com/projectdiscovery/retryabledns v1.0.6
github.com/projectdiscovery/retryabledns v1.0.7-0.20210223220509-b2042117f565
github.com/projectdiscovery/retryablehttp-go v1.0.1
github.com/remeh/sizedwaitgroup v1.0.0
github.com/rivo/uniseg v0.2.0 // indirect

View File

@ -196,8 +196,9 @@ github.com/projectdiscovery/clistats v0.0.7 h1:Q/erjrk2p3BIQq1RaHVtBpgboghNz0u1/
github.com/projectdiscovery/clistats v0.0.7/go.mod h1:lV6jUHAv2bYWqrQstqW8iVIydKJhWlVaLl3Xo9ioVGg=
github.com/projectdiscovery/collaborator v0.0.2 h1:BSiMlWM3NvuKbpedn6fIjjEo5b7q5zmiJ6tI7+6mB3s=
github.com/projectdiscovery/collaborator v0.0.2/go.mod h1:J1z0fC7Svutz3LJqoRyTHA3F0Suh4livmkYv8MnKw20=
github.com/projectdiscovery/fastdialer v0.0.6 h1:3EjSbwkf5Qv+yX7kKZB958+CVzeolGwwezgKk/h3ONU=
github.com/projectdiscovery/fastdialer v0.0.6/go.mod h1:m20Ls/JratRO8wSSpvOMIKu4aFDh9c5zwCH8+5JO0nA=
github.com/projectdiscovery/fastdialer v0.0.7-0.20210223220811-0f076345f912/go.mod h1:jBUN2zLp+mwNzGjq8VR/8u6yVV9L8eIZmJhWyHhOmYw=
github.com/projectdiscovery/fastdialer v0.0.7-0.20210224113953-30d7daf807bc h1:2EwckFGfmROEVavUqZz9mb67i6ohmVTtACqLEntRiBQ=
github.com/projectdiscovery/fastdialer v0.0.7-0.20210224113953-30d7daf807bc/go.mod h1:jBUN2zLp+mwNzGjq8VR/8u6yVV9L8eIZmJhWyHhOmYw=
github.com/projectdiscovery/goflags v0.0.2 h1:4vB5+mA41xgW6V1y4YD1A+iI8Kq68iTTny50XuSYKdo=
github.com/projectdiscovery/goflags v0.0.2/go.mod h1:Ae1mJ5MIIqjys0lFe3GiMZ10Z8VLaxkYJ1ySA4Zv8HA=
github.com/projectdiscovery/gologger v1.1.3 h1:rKWZW2QUigRV1jnlWwWJbJRvz8b+T/+bB5qemDGGBJU=
@ -206,8 +207,8 @@ github.com/projectdiscovery/hmap v0.0.1 h1:VAONbJw5jP+syI5smhsfkrq9XPGn4aiYy5pR6
github.com/projectdiscovery/hmap v0.0.1/go.mod h1:VDEfgzkKQdq7iGTKz8Ooul0NuYHQ8qiDs6r8bPD1Sb0=
github.com/projectdiscovery/rawhttp v0.0.6 h1:HbgPB1eKXQVV5F9sq0Uxflm95spWFyZYD8dgFpeOC9M=
github.com/projectdiscovery/rawhttp v0.0.6/go.mod h1:PQERZAhAv7yxI/hR6hdDPgK1WTU56l204BweXrBec+0=
github.com/projectdiscovery/retryabledns v1.0.6 h1:fz33puVeUKJJ5s2POSlxO4WA4iodW6Yzm/EVNuO/93w=
github.com/projectdiscovery/retryabledns v1.0.6/go.mod h1:/UzJn4I+cPdQl6pKiiQfvVAT636YZvJQYZhYhGB0dUQ=
github.com/projectdiscovery/retryabledns v1.0.7-0.20210223220509-b2042117f565 h1:SrHEyTVof7F0KvZ/WNPggGWJQbVs1QM/aO6yG3TfPKo=
github.com/projectdiscovery/retryabledns v1.0.7-0.20210223220509-b2042117f565/go.mod h1:/UzJn4I+cPdQl6pKiiQfvVAT636YZvJQYZhYhGB0dUQ=
github.com/projectdiscovery/retryablehttp-go v1.0.1 h1:V7wUvsZNq1Rcz7+IlcyoyQlNwshuwptuBVYWw9lx8RE=
github.com/projectdiscovery/retryablehttp-go v1.0.1/go.mod h1:SrN6iLZilNG1X4neq1D+SBxoqfAF4nyzvmevkTkWsek=
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=

View File

@ -13,6 +13,7 @@ import (
// newhttpClient creates a new http client for headless communication with a timeout
func newhttpClient(options *types.Options) (*http.Client, error) {
opts := fastdialer.DefaultOptions
opts.EnableFallback = true
if options.ResolversFile != "" {
opts.BaseResolvers = options.InternalResolversList
}

View File

@ -101,6 +101,7 @@ func wrappedGet(options *types.Options, configuration *Configuration) (*retryabl
if options.ResolversFile != "" {
opts.BaseResolvers = options.InternalResolversList
}
opts.EnableFallback = true
Dialer, err = fastdialer.NewDialer(opts)
}
if err != nil {

View File

@ -17,6 +17,7 @@ func Init(options *types.Options) error {
return nil
}
opts := fastdialer.DefaultOptions
opts.EnableFallback = true
if options.ResolversFile != "" {
opts.BaseResolvers = options.InternalResolversList
}