whois

package module
Version: v1.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 28, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

README

Whois

License GoDoc Build Status Go Report Card Code Cover

Whois is a simple Go module for domain and ip whois information query.

Overview

All of domain, IP include IPv4 and IPv6, ASN are supported.

You can directly using the binary distributions whois, follow whois release tool.

Or you can do development by using this golang module as below.

Installation

go get -u github.com/likexian/whois-go

Importing

import (
    "github.com/likexian/whois-go"
)

Documentation

Visit the docs on GoDoc

Example

whois query for domain
result, err := whois.Whois("likexian.com")
if err == nil {
    fmt.Println(result)
}
whois query for IPv6
result, err := whois.Whois("2001:dc7::1")
if err == nil {
    fmt.Println(result)
}
whois query for IPv4
result, err := whois.Whois("1.1.1.1")
if err == nil {
    fmt.Println(result)
}
whois query for ASN
// or whois.Whois("AS60614")
result, err := whois.Whois("60614")
if err == nil {
    fmt.Println(result)
}

Whois information parsing

Please refer to whois-parser-go

License

Copyright 2014-2021 Li Kexian

Licensed under the Apache License 2.0

Donation

If this project is helpful, please share it with friends.

If you want to thank me, you can give me a cup of coffee.

Documentation

Index

Constants

View Source
const (
	// IANA_WHOIS_SERVER is iana whois server
	IANA_WHOIS_SERVER = "whois.iana.org"
	// DEFAULT_WHOIS_PORT is default whois port
	DEFAULT_WHOIS_PORT = "43"
)

Variables

This section is empty.

Functions

func Author

func Author() string

Author returns package author

func IsASN added in v1.8.0

func IsASN(s string) bool

IsASN returns if s is ASN

func License

func License() string

License returns package license

func Version

func Version() string

Version returns package version

func Whois

func Whois(domain string, servers ...string) (result string, err error)

Whois do the whois query and returns whois info

Types

This section is empty.

Source Files

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL