This repository was archived by the owner on Aug 26, 2025. It is now read-only.
forked from likexian/whois
-
Notifications
You must be signed in to change notification settings - Fork 0
Update fork and support business latency requirements #2
Merged
Merged
Changes from 121 commits
Commits
Show all changes
122 commits
Select commit
Hold shift + click to select a range
384b3df
updated whois release version
likexian 902fa4d
update go mod
likexian d5fffb0
change whois dir name to cmd
likexian 5b666eb
support domain.jp/e query format
likexian c85f30c
move cmd dir to cmd/whois
likexian eb14dd1
add build whois cmd script
likexian 4c65e1a
add -h and -v arguments to whois cmd
likexian 1469fb4
add trimpath arguments to go build
likexian bad8d75
add more test cases
likexian 4056640
tld whois query support
likexian 2efe231
update go mod
likexian 20ceb52
change years of copyright
likexian d44825b
refactory whois query, domain and ipv4 and ipv6 all supported
likexian e4a36e1
go 1.14 by default and update go mod
likexian 92cfa71
refine the code and fix query ip whois
likexian 5ce0d54
More syntax highlighting in readme
HappyFacade 81965e9
Merge pull request #12 from HappyFacade/patch-1
likexian b6862d2
refine the code of query
likexian d8a359d
ignore duplicated server query
likexian c349e7b
optimize description of readme
likexian 38170a7
refined content of readme
likexian d0e981c
add parsing whois query result and output as json
likexian ad9e542
add description to usage
likexian c7dc98a
add build cmd whois for windows
likexian ba7d17f
add build cmd whois for darwin
likexian 75842d2
refine content of cmd readme
likexian 2b818a1
update version of whois parser
likexian 58e6509
change 64bit links to first
likexian 9c2d168
change years of copyright
likexian 48f8f46
go 1.15 by default
likexian c1c6a99
Add Query ASN Support
steveyiyo 0e1d523
Merge pull request #15 from steveyiyo/master
likexian b80cfdb
improve for asn query
likexian 8536f1f
important note: change mod path to whois
likexian e968767
go 1.16 by default
likexian ac91df9
ci testing with more go version
likexian e52d642
add whois client object
likexian 3b15e2f
add proxy dialer support
likexian 087a006
add const asn prefix
likexian 47e3019
fixed query with timeout time
likexian 8ad1cc1
add query time to result
likexian f9d7e12
add checking for update
likexian 9980e2b
update go mod
likexian 5319260
patch for godaddy
lapubell ff33ab1
Merge pull request #18 from lapubell/master
likexian ebc459f
Return errors that can be unwrapped
gabe565 50310fc
Add ErrDomainEmpty and ErrNoWhoisServerFound
gabe565 afb80e1
Merge pull request #19 from gabe565/master
likexian 9b99456
binary download using static link
likexian b978d88
ci using github actions
likexian a9ea206
fixed golangci-lint issues
likexian c34fee7
refine about error
likexian ab4d307
go module using 1.17
likexian 800066e
update readme for badge
likexian 6374e8f
fixed get whois server
likexian 34ca7f6
change year of copyright
likexian 8e4bedf
fixed for go to ReferralServer
likexian e04e941
update go mod
likexian 4e624a5
add auto release
likexian fdd399b
fixed for check update
likexian a7337df
update go-release-action version
likexian 854e555
Improve getServer() parser
zcalusic a48608e
Merge pull request #26 from zcalusic/master
likexian da2a39f
update go mod
likexian 91082cc
change years of copyright
likexian e1de794
fixed golangci lint issue
likexian c1a5c9b
whois: getServer: add refer: as valid refering server prefix
rissson 0bb0574
Merge pull request #32 from rissson/get-server-refer
likexian c57bc87
change whois refer orders
likexian fbac87f
fixed update cache
likexian f1703c8
optimize check update
likexian d8796a0
change comment prefix to the %
likexian 30f9adf
add option to disable stats
likexian 761ee92
Added option to disable referral lookup
csnitker-godaddy 8082fc7
Added integration test for SetDisableReferral
csnitker-godaddy f92c187
Merge pull request #34 from csnitker-godaddy/master
likexian 8adbecd
update go mod
likexian 6af733f
Bump golang.org/x/net from 0.14.0 to 0.17.0
dependabot[bot] 62a37fc
Merge pull request #38 from likexian/dependabot/go_modules/golang.org…
likexian cf6bd42
update go mod
likexian 911434f
change years of copyright
likexian d233eed
update go mod
likexian 9dd719a
add assert error message
likexian 027c73e
Make rawQuery timeout handling more thread-safe
ugexe 80bf76f
update go mod
likexian ccbc4e5
Hacky fix to set dialer timeout
jafayer 9152b68
Remove unneeded hasDialer interface, since this is defined in proxy.D…
jafayer a561183
Remove fmt.Println used for debugging and change ordering
jafayer 259e6b0
Merge pull request #45 from jafayer/jafayer/fix-dialer-timeout
likexian c01ca63
Merge pull request #42 from ugexe/patch-1
likexian 35c9053
update go mod
likexian f7e58e0
Allow Whois servers to include trailing numeric ports.
gavincarr f5b95f1
Add test for server with explicit port.
gavincarr 6ad6903
Merge pull request #48 from gavincarr/master
likexian a61bb40
Update getServer to handle %referral and rwhois urls.
gavincarr 1a3c9b3
Merge pull request #50 from gavincarr/master
likexian ccbaaf0
Return (potentially) partial buffers on error.
mfycheng 51c35de
Merge pull request #51 from mfycheng/detect-server-rate-limits
likexian c672ae7
feat: Add Option to Control Referral Chain Concatenation in WHOIS Res…
paulojmdias 1a4872b
fix: fix condition
paulojmdias 9ba6812
fix: revert
paulojmdias 73c983f
Merge pull request #55 from paulojmdias/disable_referal_chain
likexian eed3530
v1.15.6
likexian 86eae7a
merge latest of likexian upstream
ashleyelder 6b73da0
backwards compatible support for timeouts wo elapsed
ashleyelder 4253738
add/update go.mod, go.sum
ashleyelder 75a1390
fix linter
ashleyelder 657f00a
fix linting issues
ashleyelder 9fcff8c
skip cache, adjust comments
ashleyelder abe18c4
try verbose output to github action
ashleyelder 62d07c9
update golangci-lint to v2
ashleyelder 8f3fcce
fix version - same as local
ashleyelder 76f6a68
allow error to run sucessfully by fixing flag error
ashleyelder 98739af
remove flag
ashleyelder 6a28da1
try to fix incompatible github action w golangci-lint v
ashleyelder 5e0f4f3
remove leftover file to test fixing lint issue
ashleyelder ac92aa9
remove unecessary code
ashleyelder fa1609f
update README
ashleyelder 3e0068a
remove likexian whois dependency from go.mod
ashleyelder e885b43
clean modcache
ashleyelder de93688
Revert "clean modcache"
ashleyelder af1243c
cr
ashleyelder File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| # gotest.yaml | ||
| # Maintainer: https://www.likexian.com | ||
| # Licensed under the Apache License 2.0 | ||
|
|
||
| name: GoTest | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - '**' | ||
| tags-ignore: | ||
| - '**' | ||
| pull_request: | ||
| types: [opened, synchronize, reopened] | ||
|
|
||
| jobs: | ||
| lint: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Set up Go | ||
| uses: actions/setup-go@v5 | ||
| with: | ||
| go-version: '1.24' | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
| - name: Install golangci-lint v2.3.0 | ||
| run: | | ||
| curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v2.3.0 | ||
| - name: Run golangci-lint | ||
| run: | | ||
| golangci-lint run -v --verbose | ||
| test: | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| go: [1.19.x, 1.20.x, 1.21.x, 1.22.x] | ||
| os: [ubuntu-latest] | ||
| runs-on: ${{ matrix.os }} | ||
| steps: | ||
| - name: Set up Go | ||
| uses: actions/setup-go@v5 | ||
| with: | ||
| go-version: ${{ matrix.go }} | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
| - name: GoTest code | ||
| run: | | ||
| sudo go test -race -coverprofile="coverage.txt" -covermode=atomic ./... | ||
| coverage=$(go tool cover -func=coverage.txt | grep total | grep -Eo '[0-9]+\.[0-9]+') | ||
| echo "{\"coverage\": $coverage}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| # release.yaml | ||
| # Maintainer: https://www.likexian.com | ||
| # Licensed under the Apache License 2.0 | ||
|
|
||
| name: Release | ||
|
|
||
| on: | ||
| push: | ||
| tags: | ||
| - 'v**' | ||
|
|
||
| jobs: | ||
| release: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
| - name: Set up Go | ||
| uses: actions/setup-go@v5 | ||
| with: | ||
| go-version: '1.24' | ||
| - name: Build and release | ||
| uses: goreleaser/goreleaser-action@v5 | ||
| with: | ||
| distribution: goreleaser | ||
| version: latest | ||
| args: release --clean | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,2 @@ | ||
| .DS_Store | ||
| .idea |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| # .golangci.yml | ||
| # Maintainer: https://www.likexian.com | ||
| # Licensed under the Apache License 2.0 | ||
|
|
||
| version: "2" | ||
|
|
||
| run: | ||
| timeout: 5m | ||
| skip-dirs-use-default: true | ||
|
|
||
| linters: | ||
| disable-all: true | ||
| enable: | ||
| - errcheck | ||
| - govet | ||
| - ineffassign | ||
| - staticcheck | ||
| - unused | ||
| - cyclop | ||
| - durationcheck | ||
| - errname | ||
| - errorlint | ||
| - lll | ||
| - misspell | ||
| - nilerr | ||
| - nolintlint | ||
| - prealloc | ||
| - revive | ||
| - rowserrcheck | ||
| - sqlclosecheck | ||
| - unconvert | ||
| - wastedassign | ||
|
|
||
| formatters: | ||
| enable: | ||
| - gofmt | ||
| - goimports | ||
|
|
||
| linters-settings: | ||
| cyclop: | ||
| max-complexity: 20 | ||
| package-average: 10.0 | ||
| skip-tests: true | ||
|
|
||
| issues: | ||
| max-issues-per-linter: 0 | ||
| max-same-issues: 0 | ||
| exclude-rules: | ||
| - path: _test\.go | ||
| linters: | ||
| - errcheck | ||
| - source: "^//go:generate " | ||
| linters: | ||
| - lll |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,47 +1,59 @@ | ||
| # whois.go | ||
| # Whois | ||
|
|
||
| [](LICENSE) | ||
| [](https://godoc.org/github.com/likexian/whois-go) | ||
| [](https://travis-ci.org/likexian/whois-go) | ||
| [](https://goreportcard.com/report/github.com/likexian/whois-go) | ||
| [](https://codecov.io/gh/likexian/whois-go) | ||
| [](https://pkg.go.dev/github.com/mailgun/whois-go) | ||
|
|
||
| whois-go is a simple Go module for domain and ip whois info query. | ||
| **This is a fork of [github.com/likexian/whois](https://github.com/likexian/whois) maintained by Mailgun.** | ||
|
|
||
| Whois is a simple Go module for domain and ip whois information query. | ||
|
|
||
| ## Overview | ||
|
|
||
| You can directly using the binary distributions whois, follow [whois release tool](whois). | ||
| All of domain, IP include IPv4 and IPv6, ASN are supported. | ||
|
|
||
| Or you can do development by using the golang module as below. | ||
| You can directly using the binary distributions whois, follow [whois release tool](cmd/whois). | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit-grammar: "you can directly using" |
||
|
|
||
| *Works for most domain extensions and most ip most of the time.* | ||
| Or you can do development by using this golang module as below. | ||
|
|
||
| ## Installation | ||
|
|
||
| go get -u github.com/likexian/whois-go | ||
| ```shell | ||
| go get -u github.com/mailgun/whois-go | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. note: we've been avoiding |
||
| ``` | ||
|
|
||
| ## Importing | ||
|
|
||
| import ( | ||
| "github.com/likexian/whois-go" | ||
| ) | ||
| ```go | ||
| import ( | ||
| "github.com/mailgun/whois-go" | ||
| ) | ||
| ``` | ||
|
|
||
| ## Documentation | ||
|
|
||
| Visit the docs on [GoDoc](https://godoc.org/github.com/likexian/whois-go) | ||
| Visit the docs on [GoDoc](https://pkg.go.dev/github.com/mailgun/whois-go) | ||
|
|
||
| ## Example | ||
|
|
||
| ### whois query for domain | ||
|
|
||
| ```go | ||
| result, err := whois.Whois("example.com") | ||
| result, err := whois.Whois("likexian.com") | ||
| if err == nil { | ||
| fmt.Println(result) | ||
| } | ||
| ``` | ||
|
|
||
| ### whois query for ip | ||
| ### whois query for IPv6 | ||
|
|
||
| ```go | ||
| result, err := whois.Whois("2001:dc7::1") | ||
| if err == nil { | ||
| fmt.Println(result) | ||
| } | ||
| ``` | ||
|
|
||
| ### whois query for IPv4 | ||
|
|
||
| ```go | ||
| result, err := whois.Whois("1.1.1.1") | ||
|
|
@@ -50,20 +62,29 @@ if err == nil { | |
| } | ||
| ``` | ||
|
|
||
| ## Whois info parser in Go | ||
| ### whois query for ASN | ||
|
|
||
| Please refer to [whois-parser-go](https://github.com/likexian/whois-parser-go) | ||
| ```go | ||
| // or whois.Whois("AS60614") | ||
| result, err := whois.Whois("60614") | ||
| if err == nil { | ||
| fmt.Println(result) | ||
| } | ||
| ``` | ||
|
|
||
| ## LICENSE | ||
| ## Whois information parsing | ||
|
|
||
| Copyright 2014-2019 Li Kexian | ||
| Please refer to [whois-parser](https://github.com/likexian/whois-parser) | ||
|
|
||
| Licensed under the Apache License 2.0 | ||
| ## License | ||
|
|
||
| ## About | ||
| Copyright 2014-2025 [Li Kexian](https://www.likexian.com/) | ||
| Copyright 2019-2025 Mailgun Technologies, Inc. | ||
|
|
||
| Licensed under the Apache License 2.0 | ||
|
|
||
| - [Li Kexian](https://www.likexian.com/) | ||
| ## Donation | ||
|
|
||
| ## DONATE | ||
| If this project is helpful, please share it with friends. | ||
|
|
||
| - [Help me make perfect](https://www.likexian.com/donate/) | ||
| If you want to thank the original author, you can [give Li Kexian a cup of coffee](https://www.likexian.com/donate/). | ||
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| # Whois | ||
|
|
||
| Whois is a release tool for domain and ip whois information query. | ||
|
|
||
| ## Overview | ||
|
|
||
| All of domain, IP include IPv4 and IPv6, ASN are supported. | ||
|
|
||
| **This is a fork of [github.com/likexian/whois](https://github.com/likexian/whois) maintained by Mailgun.** | ||
|
|
||
| ## Usage | ||
|
|
||
| ### whois query for domain | ||
|
|
||
| ```shell | ||
| whois example.com | ||
| ``` | ||
|
|
||
| ### whois query for IPv6 | ||
|
|
||
| ```shell | ||
| whois 2001:dc7::1 | ||
| ``` | ||
|
|
||
| ### whois query for IPv4 | ||
|
|
||
| ```shell | ||
| whois 1.1.1.1 | ||
| ``` | ||
|
|
||
| ### whois query for ASN | ||
|
|
||
| ```shell | ||
| # or whois as60614 | ||
| whois 60614 | ||
| ``` | ||
|
|
||
| ### whois query output as json | ||
|
|
||
| ```shell | ||
| whois -j example.com | ||
| ``` | ||
|
|
||
| ## License | ||
|
|
||
| Copyright 2014-2024 [Li Kexian](https://www.likexian.com/) | ||
| Copyright 2019-2025 Mailgun Technologies, Inc. | ||
|
|
||
| Licensed under the Apache License 2.0 | ||
|
|
||
| ## Donation | ||
|
|
||
| If this project is helpful, please share it with friends. | ||
|
|
||
| If you want to thank the original author, you can [give Li Kexian a cup of coffee](https://www.likexian.com/donate/). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| #!/bin/bash | ||
|
|
||
| arch=386 | ||
| for os in linux windows; do | ||
| echo "Building whois-$os-$arch..." | ||
| GOOS=$os GOARCH=$arch go build -trimpath -ldflags '-w -s' -o whois | ||
| zip whois-$os-$arch.zip whois | ||
| rm -rf whois | ||
| done | ||
|
|
||
| arch=amd64 | ||
| for os in linux windows darwin; do | ||
| echo "Building whois-$os-$arch..." | ||
| GOOS=$os GOARCH=$arch go build -trimpath -ldflags '-w -s' -o whois | ||
| zip whois-$os-$arch.zip whois | ||
| rm -rf whois | ||
| done |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... for
module github.com/mailgun/whois-go