Skip to content
This repository was archived by the owner on Aug 26, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
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 Jun 13, 2019
902fa4d
update go mod
likexian Sep 27, 2019
d5fffb0
change whois dir name to cmd
likexian Sep 27, 2019
5b666eb
support domain.jp/e query format
likexian Oct 24, 2019
c85f30c
move cmd dir to cmd/whois
likexian Oct 24, 2019
eb14dd1
add build whois cmd script
likexian Oct 30, 2019
4c65e1a
add -h and -v arguments to whois cmd
likexian Oct 31, 2019
1469fb4
add trimpath arguments to go build
likexian Nov 5, 2019
bad8d75
add more test cases
likexian Nov 5, 2019
4056640
tld whois query support
likexian Nov 19, 2019
2efe231
update go mod
likexian Nov 24, 2019
20ceb52
change years of copyright
likexian Jan 18, 2020
d44825b
refactory whois query, domain and ipv4 and ipv6 all supported
likexian Apr 1, 2020
e4a36e1
go 1.14 by default and update go mod
likexian Apr 4, 2020
92cfa71
refine the code and fix query ip whois
likexian Apr 5, 2020
5ce0d54
More syntax highlighting in readme
HappyFacade Apr 8, 2020
81965e9
Merge pull request #12 from HappyFacade/patch-1
likexian Apr 9, 2020
b6862d2
refine the code of query
likexian Apr 11, 2020
d8a359d
ignore duplicated server query
likexian Apr 11, 2020
c349e7b
optimize description of readme
likexian Apr 11, 2020
38170a7
refined content of readme
likexian May 7, 2020
d0e981c
add parsing whois query result and output as json
likexian May 7, 2020
ad9e542
add description to usage
likexian May 9, 2020
c7dc98a
add build cmd whois for windows
likexian May 9, 2020
ba7d17f
add build cmd whois for darwin
likexian May 11, 2020
75842d2
refine content of cmd readme
likexian May 11, 2020
2b818a1
update version of whois parser
likexian Aug 26, 2020
58e6509
change 64bit links to first
likexian Aug 26, 2020
9c2d168
change years of copyright
likexian Jan 17, 2021
48f8f46
go 1.15 by default
likexian Jan 17, 2021
c1c6a99
Add Query ASN Support
steveyiyo Jan 27, 2021
0e1d523
Merge pull request #15 from steveyiyo/master
likexian Jan 28, 2021
b80cfdb
improve for asn query
likexian Jan 28, 2021
8536f1f
important note: change mod path to whois
likexian Feb 28, 2021
e968767
go 1.16 by default
likexian Feb 28, 2021
ac91df9
ci testing with more go version
likexian Mar 1, 2021
e52d642
add whois client object
likexian Mar 2, 2021
3b15e2f
add proxy dialer support
likexian Mar 3, 2021
087a006
add const asn prefix
likexian Mar 4, 2021
47e3019
fixed query with timeout time
likexian Mar 6, 2021
8ad1cc1
add query time to result
likexian Mar 6, 2021
f9d7e12
add checking for update
likexian May 12, 2021
9980e2b
update go mod
likexian May 12, 2021
5319260
patch for godaddy
lapubell Jul 28, 2021
ff33ab1
Merge pull request #18 from lapubell/master
likexian Aug 22, 2021
ebc459f
Return errors that can be unwrapped
gabe565 Aug 27, 2021
50310fc
Add ErrDomainEmpty and ErrNoWhoisServerFound
gabe565 Aug 27, 2021
afb80e1
Merge pull request #19 from gabe565/master
likexian Aug 29, 2021
9b99456
binary download using static link
likexian Sep 29, 2021
b978d88
ci using github actions
likexian Oct 2, 2021
a9ea206
fixed golangci-lint issues
likexian Oct 2, 2021
c34fee7
refine about error
likexian Oct 4, 2021
ab4d307
go module using 1.17
likexian Oct 4, 2021
800066e
update readme for badge
likexian Oct 4, 2021
6374e8f
fixed get whois server
likexian Mar 23, 2022
34ca7f6
change year of copyright
likexian Apr 4, 2022
8e4bedf
fixed for go to ReferralServer
likexian Apr 7, 2022
e04e941
update go mod
likexian Jul 3, 2022
4e624a5
add auto release
likexian Jul 3, 2022
fdd399b
fixed for check update
likexian Jul 3, 2022
a7337df
update go-release-action version
likexian Jul 10, 2022
854e555
Improve getServer() parser
zcalusic Oct 11, 2022
a48608e
Merge pull request #26 from zcalusic/master
likexian Oct 12, 2022
da2a39f
update go mod
likexian Nov 21, 2022
91082cc
change years of copyright
likexian Mar 1, 2023
e1de794
fixed golangci lint issue
likexian Mar 1, 2023
c1a5c9b
whois: getServer: add refer: as valid refering server prefix
rissson Mar 5, 2023
0bb0574
Merge pull request #32 from rissson/get-server-refer
likexian Mar 13, 2023
c57bc87
change whois refer orders
likexian Mar 13, 2023
fbac87f
fixed update cache
likexian Apr 29, 2023
f1703c8
optimize check update
likexian Apr 29, 2023
d8796a0
change comment prefix to the %
likexian Apr 29, 2023
30f9adf
add option to disable stats
likexian Apr 29, 2023
761ee92
Added option to disable referral lookup
csnitker-godaddy May 2, 2023
8082fc7
Added integration test for SetDisableReferral
csnitker-godaddy May 2, 2023
f92c187
Merge pull request #34 from csnitker-godaddy/master
likexian May 4, 2023
8adbecd
update go mod
likexian Aug 29, 2023
6af733f
Bump golang.org/x/net from 0.14.0 to 0.17.0
dependabot[bot] Oct 11, 2023
62a37fc
Merge pull request #38 from likexian/dependabot/go_modules/golang.org…
likexian Oct 12, 2023
cf6bd42
update go mod
likexian Apr 7, 2024
911434f
change years of copyright
likexian Apr 29, 2024
d233eed
update go mod
likexian Apr 29, 2024
9dd719a
add assert error message
likexian Apr 29, 2024
027c73e
Make rawQuery timeout handling more thread-safe
ugexe May 12, 2024
80bf76f
update go mod
likexian Jul 15, 2024
ccbc4e5
Hacky fix to set dialer timeout
jafayer Aug 29, 2024
9152b68
Remove unneeded hasDialer interface, since this is defined in proxy.D…
jafayer Aug 29, 2024
a561183
Remove fmt.Println used for debugging and change ordering
jafayer Aug 29, 2024
259e6b0
Merge pull request #45 from jafayer/jafayer/fix-dialer-timeout
likexian Sep 2, 2024
c01ca63
Merge pull request #42 from ugexe/patch-1
likexian Sep 2, 2024
35c9053
update go mod
likexian Sep 2, 2024
f7e58e0
Allow Whois servers to include trailing numeric ports.
gavincarr Oct 8, 2024
f5b95f1
Add test for server with explicit port.
gavincarr Oct 8, 2024
6ad6903
Merge pull request #48 from gavincarr/master
likexian Oct 9, 2024
a61bb40
Update getServer to handle %referral and rwhois urls.
gavincarr Oct 14, 2024
1a3c9b3
Merge pull request #50 from gavincarr/master
likexian Oct 14, 2024
ccbaaf0
Return (potentially) partial buffers on error.
mfycheng Nov 6, 2024
51c35de
Merge pull request #51 from mfycheng/detect-server-rate-limits
likexian Nov 8, 2024
c672ae7
feat: Add Option to Control Referral Chain Concatenation in WHOIS Res…
paulojmdias Feb 20, 2025
1a4872b
fix: fix condition
paulojmdias Feb 20, 2025
9ba6812
fix: revert
paulojmdias Feb 20, 2025
73c983f
Merge pull request #55 from paulojmdias/disable_referal_chain
likexian Feb 21, 2025
eed3530
v1.15.6
likexian Feb 26, 2025
86eae7a
merge latest of likexian upstream
ashleyelder Jul 31, 2025
6b73da0
backwards compatible support for timeouts wo elapsed
ashleyelder Aug 1, 2025
4253738
add/update go.mod, go.sum
ashleyelder Aug 1, 2025
75a1390
fix linter
ashleyelder Aug 1, 2025
657f00a
fix linting issues
ashleyelder Aug 1, 2025
9fcff8c
skip cache, adjust comments
ashleyelder Aug 1, 2025
abe18c4
try verbose output to github action
ashleyelder Aug 1, 2025
62d07c9
update golangci-lint to v2
ashleyelder Aug 1, 2025
8f3fcce
fix version - same as local
ashleyelder Aug 1, 2025
76f6a68
allow error to run sucessfully by fixing flag error
ashleyelder Aug 1, 2025
98739af
remove flag
ashleyelder Aug 1, 2025
6a28da1
try to fix incompatible github action w golangci-lint v
ashleyelder Aug 1, 2025
5e0f4f3
remove leftover file to test fixing lint issue
ashleyelder Aug 1, 2025
ac92aa9
remove unecessary code
ashleyelder Aug 1, 2025
fa1609f
update README
ashleyelder Aug 1, 2025
3e0068a
remove likexian whois dependency from go.mod
ashleyelder Aug 12, 2025
e885b43
clean modcache
ashleyelder Aug 12, 2025
de93688
Revert "clean modcache"
ashleyelder Aug 12, 2025
af1243c
cr
ashleyelder Aug 15, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions .github/workflows/gotest.yaml
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}"
29 changes: 29 additions & 0 deletions .github/workflows/release.yaml

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this?

Copy link
Copy Markdown

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

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 }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
.DS_Store
.idea
54 changes: 54 additions & 0 deletions .golangci.yml
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
7 changes: 0 additions & 7 deletions .travis.yml

This file was deleted.

4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2014-2019 Li Kexian
Copyright 2014-2024 Li Kexian

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -200,6 +200,6 @@
See the License for the specific language governing permissions and
limitations under the License.

APPENDIX: Copyright 2014-2019 Li Kexian
APPENDIX: Copyright 2014-2024 Li Kexian

https://www.likexian.com/
71 changes: 46 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,47 +1,59 @@
# whois.go
# Whois

[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](LICENSE)
[![GoDoc](https://godoc.org/github.com/likexian/whois-go?status.svg)](https://godoc.org/github.com/likexian/whois-go)
[![Build Status](https://travis-ci.org/likexian/whois-go.svg?branch=master)](https://travis-ci.org/likexian/whois-go)
[![Go Report Card](https://goreportcard.com/badge/github.com/likexian/whois-go)](https://goreportcard.com/report/github.com/likexian/whois-go)
[![Code Cover](https://codecov.io/gh/likexian/whois-go/graph/badge.svg)](https://codecov.io/gh/likexian/whois-go)
[![GoDoc](https://pkg.go.dev/badge/github.com/mailgun/whois-go.svg)](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).

Copy link
Copy Markdown

Choose a reason for hiding this comment

The 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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note: we've been avoiding -u for a variety of reasons.

```

## 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")
Expand All @@ -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.
55 changes: 55 additions & 0 deletions cmd/whois/README.md
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/).
17 changes: 17 additions & 0 deletions cmd/whois/build.sh
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
Loading
Loading