Skip to content

Commit

Permalink
Use zmap/dns instead of miekg/dns with replace directive (zmap#263
Browse files Browse the repository at this point in the history
)

* switch over to using zmap/dns

* update to go 1.17

* update CI to use go 1.17
  • Loading branch information
spencerdrak authored Jan 28, 2022
1 parent 6ea6c13 commit bfbfae2
Show file tree
Hide file tree
Showing 21 changed files with 59 additions and 38 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: '1.13'
go-version: '1.17'
- name: Build
run: |
go version
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
zdns/zdns
.*
*.iml
*.code-workspace
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ ZDNS
ZDNS is a command-line utility that provides high-speed DNS lookups. ZDNS is
written in Go and contains its own recursive resolution code and a cache
optimized for performing lookups of a diverse set of names. We use
https://github.com/miekg/dns to construct and parse raw DNS packets.
https://github.com/zmap/dns to construct and parse raw DNS packets.

As an example, the following will perform MX lookups and a secondary A lookup
for the IPs of MX servers for the domains in the Alexa Top Million:
Expand Down
17 changes: 11 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
module github.com/zmap/zdns

go 1.13
go 1.17

require (
github.com/asergeyev/nradix v0.0.0-20170505151046-3872ab85bb56 // indirect
github.com/hashicorp/go-version v1.2.0
github.com/liip/sheriff v0.0.0-20190308094614-91aa83a45a3d
github.com/miekg/dns v1.1.27
github.com/sirupsen/logrus v1.4.2
github.com/zmap/dns v1.1.45-zdns-0
github.com/zmap/go-iptree v0.0.0-20170831022036-1948b1097e25
golang.org/x/crypto v0.0.0-20200117160349-530e935923ad // indirect
golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa // indirect
)

replace github.com/miekg/dns => github.com/zmap/dns v1.1.35-zdns-2
require (
github.com/asergeyev/nradix v0.0.0-20170505151046-3872ab85bb56 // indirect
github.com/konsorten/go-windows-terminal-sequences v1.0.1 // indirect
golang.org/x/mod v0.4.2 // indirect
golang.org/x/net v0.0.0-20210726213435-c6fcb2dbf985 // indirect
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c // indirect
golang.org/x/tools v0.1.6-0.20210726203631-07bc1bf47fb2 // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
)
38 changes: 26 additions & 12 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,41 @@ github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6Mwd
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/zmap/dns v1.1.35-zdns-2 h1:qypJOLrTnTFiWjF7r9Dl8DANG5yKh1hOgsCDNuOY/UA=
github.com/zmap/dns v1.1.35-zdns-2/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM=
github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
github.com/zmap/dns v1.1.45-zdns-0 h1:vq8YbeTTtNdwqVwsIS0tGNxjQnERJaeWK5t+y6gyu6c=
github.com/zmap/dns v1.1.45-zdns-0/go.mod h1:VX0yIJQGQ8j0uBvjD3O+UmwrsUG3+LaFMtmdw3kTcAk=
github.com/zmap/go-iptree v0.0.0-20170831022036-1948b1097e25 h1:LRoXAcKX48QV4LV23W5ZtsG/MbJOgNUNvWiXwM0iLWw=
github.com/zmap/go-iptree v0.0.0-20170831022036-1948b1097e25/go.mod h1:qOasALtPByO1Jk6LhgpNv6htPMK2QJfiGorUk57nO/U=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200117160349-530e935923ad h1:Jh8cai0fqIK+f6nG0UgPW5wFk8wmiMhM3AyciDBdtQg=
golang.org/x/crypto v0.0.0-20200117160349-530e935923ad/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
golang.org/x/mod v0.4.2 h1:Gz96sIWK3OalVv/I/qNygP42zyoKp3xptRVCWRFEBvo=
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa h1:F+8P+gmewFQYRk6JoLQLwjBCTu3mcIURZfNkVweuRKA=
golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/sync v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU=
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
golang.org/x/net v0.0.0-20210726213435-c6fcb2dbf985 h1:4CSI6oo7cOjJKajidEljs9h+uP0rRZBPPPhcCbj5mw8=
golang.org/x/net v0.0.0-20210726213435-c6fcb2dbf985/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ=
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe h1:6fAMxZRR6sl1Uq8U61gxU+kPTs2tR8uOySCbBP7BN/M=
golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c h1:F1jZWGFhYfh0Ci55sIpILtKKK8p3i2/krTr0H1rg74I=
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/tools v0.0.0-20191216052735-49a3e744a425/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.1.6-0.20210726203631-07bc1bf47fb2 h1:BonxutuHCTL0rBDnZlKjpGIQFTjyUVTexFOdWkB6Fg0=
golang.org/x/tools v0.1.6-0.20210726203631-07bc1bf47fb2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
2 changes: 1 addition & 1 deletion lookup.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import (

"github.com/hashicorp/go-version"
"github.com/liip/sheriff"
"github.com/miekg/dns"
log "github.com/sirupsen/logrus"
"github.com/zmap/dns"
)

type routineMetadata struct {
Expand Down
2 changes: 1 addition & 1 deletion modules/alookup/alookup.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"flag"
"strings"

"github.com/miekg/dns"
"github.com/zmap/dns"
"github.com/zmap/zdns"
"github.com/zmap/zdns/modules/miekg"
)
Expand Down
2 changes: 1 addition & 1 deletion modules/alookup/alookup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"reflect"
"testing"

"github.com/miekg/dns"
"github.com/zmap/dns"
"github.com/zmap/zdns"
"github.com/zmap/zdns/modules/miekg"
)
Expand Down
2 changes: 1 addition & 1 deletion modules/axfr/axfr.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (

log "github.com/sirupsen/logrus"

"github.com/miekg/dns"
"github.com/zmap/dns"
"github.com/zmap/go-iptree/blacklist"
"github.com/zmap/zdns"
"github.com/zmap/zdns/modules/miekg"
Expand Down
2 changes: 1 addition & 1 deletion modules/bindversion/bindversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
package bindversion

import (
"github.com/miekg/dns"
"github.com/zmap/dns"
"github.com/zmap/zdns"
"github.com/zmap/zdns/modules/miekg"
)
Expand Down
2 changes: 1 addition & 1 deletion modules/dmarc/dmarc.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
package dmarc

import (
"github.com/miekg/dns"
"github.com/zmap/dns"
"github.com/zmap/zdns"
"github.com/zmap/zdns/modules/miekg"
)
Expand Down
6 changes: 3 additions & 3 deletions modules/miekg/answers.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"strconv"
"strings"

"github.com/miekg/dns"
"github.com/zmap/dns"
)

type Answer struct {
Expand Down Expand Up @@ -236,7 +236,7 @@ type URIAnswer struct {
Target string `json:"previous_name" groups:"short,normal,long,trace"`
}

// copy-paste from miekg/dns/types.go >>>>>
// copy-paste from zmap/dns/types.go >>>>>
//
// Copyright (c) 2009 The Go Authors.
//
Expand Down Expand Up @@ -397,7 +397,7 @@ func makeSVCBAnswer(cAns *dns.SVCB) SVCBAnswer {
params = make(map[string]interface{})
for _, ikv := range cAns.Value {
// this could be reduced by adding, e.g., a new Data()
// method to the miekg/dns SVCBKeyValue interface
// method to the zmap/dns SVCBKeyValue interface
switch kv := ikv.(type) {
case *dns.SVCBMandatory:
keys := make([]string, len(kv.Code))
Expand Down
2 changes: 1 addition & 1 deletion modules/miekg/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (

log "github.com/sirupsen/logrus"

"github.com/miekg/dns"
"github.com/zmap/dns"
"github.com/zmap/zdns/cachehash"
)

Expand Down
2 changes: 1 addition & 1 deletion modules/miekg/miekg.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (

log "github.com/sirupsen/logrus"

"github.com/miekg/dns"
"github.com/zmap/dns"
"github.com/zmap/go-iptree/blacklist"
"github.com/zmap/zdns"
)
Expand Down
3 changes: 2 additions & 1 deletion modules/miekg/miekg_test.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package miekg

import (
"github.com/miekg/dns"
"net"
"testing"

"github.com/zmap/dns"
)

func TestParseAnswer(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion modules/miekg/modules.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package miekg

import (
"github.com/miekg/dns"
"github.com/zmap/dns"
"github.com/zmap/zdns"
)

Expand Down
2 changes: 1 addition & 1 deletion modules/miekg/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"
"strings"

"github.com/miekg/dns"
"github.com/zmap/dns"
"github.com/zmap/zdns"
)

Expand Down
2 changes: 1 addition & 1 deletion modules/mxlookup/mxlookup.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"strings"
"sync"

"github.com/miekg/dns"
"github.com/zmap/dns"
"github.com/zmap/zdns"
"github.com/zmap/zdns/cachehash"
"github.com/zmap/zdns/modules/miekg"
Expand Down
2 changes: 1 addition & 1 deletion modules/nslookup/nslookup.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"flag"
"strings"

"github.com/miekg/dns"
"github.com/zmap/dns"
"github.com/zmap/zdns"
"github.com/zmap/zdns/modules/miekg"
)
Expand Down
2 changes: 1 addition & 1 deletion modules/spf/spf.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
package spf

import (
"github.com/miekg/dns"
"github.com/zmap/dns"
"github.com/zmap/zdns"
"github.com/zmap/zdns/modules/miekg"
)
Expand Down
2 changes: 1 addition & 1 deletion zdns/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import (
"strings"
"time"

"github.com/miekg/dns"
log "github.com/sirupsen/logrus"
"github.com/zmap/dns"
"github.com/zmap/zdns"
_ "github.com/zmap/zdns/modules/alookup"
_ "github.com/zmap/zdns/modules/axfr"
Expand Down

0 comments on commit bfbfae2

Please sign in to comment.