diff --git a/pkg/query/print.go b/pkg/query/print.go index 33734d6..edfb72a 100644 --- a/pkg/query/print.go +++ b/pkg/query/print.go @@ -302,7 +302,7 @@ func MakePrintable(res util.Response, opts *util.Options) (*Message, error) { temp := strings.Split(answer.String(), "\t") var ( - ttl string + ttl any name string ) @@ -310,7 +310,7 @@ func MakePrintable(res util.Response, opts *util.Options) (*Message, error) { if opts.Display.HumanTTL { ttl = (time.Duration(answer.Header().Ttl) * time.Second).String() } else { - ttl = strconv.Itoa(int(answer.Header().Ttl)) + ttl = answer.Header().Ttl } } diff --git a/pkg/query/struct.go b/pkg/query/struct.go index 3ad2159..1b063c3 100644 --- a/pkg/query/struct.go +++ b/pkg/query/struct.go @@ -51,7 +51,7 @@ type Question struct { // RRHeader is for DNS Resource Headers. type RRHeader struct { Name string `json:"name,omitempty" xml:"name,omitempty" yaml:"name,omitempty" example:"127.0.0.1"` - TTL string `json:"ttl,omitempty" xml:"ttl,omitempty" yaml:"ttl,omitempty" example:"0ms"` + TTL any `json:"ttl,omitempty" xml:"ttl,omitempty" yaml:"ttl,omitempty" example:"0ms"` Class string `json:"class,omitempty" xml:"class,omitempty" yaml:"class,omitempty" example:"A"` Type string `json:"type,omitempty" xml:"type,omitempty" yaml:"type,omitempty" example:"IN"` Rdlength uint16 `json:"-" xml:"-" yaml:"-"`