Skip to content

Commit

Permalink
Merge pull request #743 from projectdiscovery/feat-376-dns-proxy
Browse files Browse the repository at this point in the history
Adding proxy
  • Loading branch information
Mzack9999 authored Nov 11, 2024
2 parents 89f443f + 3698edc commit aaf7d90
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions internal/runner/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ type Options struct {
HealthCheck bool
DisableUpdateCheck bool
PdcpAuth string
Proxy string
}

// ShouldLoadResume resume file
Expand Down Expand Up @@ -180,6 +181,7 @@ func ParseOptions() *Options {
flagSet.StringVarP(&options.Resolvers, "resolver", "r", "", "list of resolvers to use (file or comma separated)"),
flagSet.IntVarP(&options.WildcardThreshold, "wildcard-threshold", "wt", 5, "wildcard filter threshold"),
flagSet.StringVarP(&options.WildcardDomain, "wildcard-domain", "wd", "", "domain name for wildcard filtering (other flags will be ignored - only json output is supported)"),
flagSet.StringVar(&options.Proxy, "proxy", "", "proxy to use (eg socks5://127.0.0.1:8080)"),
)

_ = flagSet.Parse()
Expand Down
1 change: 1 addition & 0 deletions internal/runner/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ func New(options *Options) (*Runner, error) {
dnsxOptions.TraceMaxRecursion = options.TraceMaxRecursion
dnsxOptions.Hostsfile = options.HostsFile
dnsxOptions.OutputCDN = options.OutputCDN
dnsxOptions.Proxy = options.Proxy
if options.Resolvers != "" {
dnsxOptions.BaseResolvers = []string{}
// If it's a file load resolvers from it
Expand Down
5 changes: 3 additions & 2 deletions libs/dnsx/dnsx.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"encoding/json"
"errors"
"fmt"
"math"

miekgdns "github.com/miekg/dns"
"github.com/projectdiscovery/cdncheck"
Expand All @@ -30,6 +29,7 @@ type Options struct {
Hostsfile bool
OutputCDN bool
QueryAll bool
Proxy string
}

// ResponseData to show output result
Expand Down Expand Up @@ -72,7 +72,7 @@ var DefaultOptions = Options{
BaseResolvers: DefaultResolvers,
MaxRetries: 5,
QuestionTypes: []uint16{miekgdns.TypeA},
TraceMaxRecursion: math.MaxUint16,
TraceMaxRecursion: 255,
Hostsfile: true,
}

Expand All @@ -94,6 +94,7 @@ func New(options Options) (*DNSX, error) {
BaseResolvers: options.BaseResolvers,
MaxRetries: options.MaxRetries,
Hostsfile: options.Hostsfile,
Proxy: options.Proxy,
}

dnsClient, err := retryabledns.NewWithOptions(retryablednsOptions)
Expand Down

0 comments on commit aaf7d90

Please sign in to comment.