2021-02-26 15:36:46 +01:00
|
|
|
package models
|
|
|
|
|
|
|
|
import "time"
|
|
|
|
|
|
|
|
const (
|
2021-06-25 13:55:04 +02:00
|
|
|
// DefaultTLSPort specifies the default port for a DNS server connecting over TCP over TLS.
|
2021-02-26 15:36:46 +01:00
|
|
|
DefaultTLSPort = "853"
|
2021-06-25 13:55:04 +02:00
|
|
|
// DefaultUDPPort specifies the default port for a DNS server connecting over UDP.
|
2021-02-26 15:36:46 +01:00
|
|
|
DefaultUDPPort = "53"
|
2021-06-25 13:55:04 +02:00
|
|
|
// DefaultTCPPort specifies the default port for a DNS server connecting over TCP.
|
2021-12-11 16:45:24 +01:00
|
|
|
DefaultTCPPort = "53"
|
|
|
|
// DefaultDOQPort specifies the default port for a DNS server connecting over DNS over QUIC.
|
|
|
|
DefaultDOQPort = "784"
|
2021-04-24 17:27:43 +02:00
|
|
|
UDPResolver = "udp"
|
|
|
|
DOHResolver = "doh"
|
|
|
|
TCPResolver = "tcp"
|
|
|
|
DOTResolver = "dot"
|
|
|
|
DNSCryptResolver = "dnscrypt"
|
2021-12-11 16:45:24 +01:00
|
|
|
DOQResolver = "doq"
|
2021-02-26 15:36:46 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
// QueryFlags is used store the query params
|
|
|
|
// supplied by the user.
|
|
|
|
type QueryFlags struct {
|
2021-02-27 06:26:33 +01:00
|
|
|
QNames []string `koanf:"query" json:"query"`
|
|
|
|
QTypes []string `koanf:"type" json:"type"`
|
|
|
|
QClasses []string `koanf:"class" json:"class"`
|
|
|
|
Nameservers []string `koanf:"nameservers" json:"nameservers"`
|
|
|
|
UseIPv4 bool `koanf:"ipv4" json:"ipv4"`
|
|
|
|
UseIPv6 bool `koanf:"ipv6" json:"ipv6"`
|
|
|
|
Ndots int `koanf:"ndots" json:"ndots"`
|
|
|
|
Timeout time.Duration `koanf:"timeout" json:"timeout"`
|
2021-03-02 13:51:59 +01:00
|
|
|
Color bool `koanf:"color" json:"-"`
|
2021-02-27 09:31:59 +01:00
|
|
|
DisplayTimeTaken bool `koanf:"time" json:"-"`
|
|
|
|
ShowJSON bool `koanf:"json" json:"-"`
|
2022-05-17 07:04:55 +02:00
|
|
|
ShortOutput bool `koanf:"short" short:"-"`
|
2021-02-27 09:31:59 +01:00
|
|
|
UseSearchList bool `koanf:"search" json:"-"`
|
2021-06-25 13:55:04 +02:00
|
|
|
ReverseLookup bool `koanf:"reverse" reverse:"-"`
|
2022-05-17 06:51:14 +02:00
|
|
|
Strategy string `koanf:"strategy" strategy:"-"`
|
2021-02-26 15:36:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// Nameserver represents the type of Nameserver
|
|
|
|
// along with the server address.
|
|
|
|
type Nameserver struct {
|
|
|
|
Address string
|
|
|
|
Type string
|
|
|
|
}
|