Change IP struct to string

This commit is contained in:
perp 2024-07-09 17:54:15 +01:00
parent 6ad6e3429f
commit 51db0308cf
3 changed files with 6 additions and 9 deletions

View File

@ -4,7 +4,6 @@ import (
"errors" "errors"
"fmt" "fmt"
"math/rand" "math/rand"
"net"
"strings" "strings"
"github.com/miekg/dns" "github.com/miekg/dns"
@ -42,7 +41,7 @@ func (q *Query) A() {
} }
// Store IPs // Store IPs
var ips []net.IP var ips []string
// Go through answers // Go through answers
for _, answer := range resp.Answer { for _, answer := range resp.Answer {
@ -53,7 +52,7 @@ func (q *Query) A() {
} }
// Append IPv4 // Append IPv4
ips = append(ips, record.A) ips = append(ips, record.A.String())
} }
// No IPs found // No IPs found

View File

@ -4,7 +4,6 @@ import (
"errors" "errors"
"fmt" "fmt"
"math/rand" "math/rand"
"net"
"strings" "strings"
"github.com/miekg/dns" "github.com/miekg/dns"
@ -42,7 +41,7 @@ func (q *Query) AAAA() {
} }
// Store IPs // Store IPs
var ips []net.IP var ips []string
// Go through answers // Go through answers
for _, answer := range resp.Answer { for _, answer := range resp.Answer {
@ -53,7 +52,7 @@ func (q *Query) AAAA() {
} }
// Append IPv6 // Append IPv6
ips = append(ips, record.AAAA) ips = append(ips, record.AAAA.String())
} }
// No IPs found // No IPs found

View File

@ -2,7 +2,6 @@ package dns
import ( import (
"math/rand" "math/rand"
"net"
"time" "time"
"github.com/miekg/dns" "github.com/miekg/dns"
@ -21,8 +20,8 @@ type Query struct {
type Result struct { type Result struct {
Domain string // Target domain Domain string // Target domain
Subdomain string // Target subdomain Subdomain string // Target subdomain
IPv4 []net.IP // IPv4 hosts IPv4 []string // IPv4 hosts
IPv6 []net.IP // IPv6 hosts IPv6 []string // IPv6 hosts
Error error // Error response Error error // Error response
} }