whois

package module
v0.0.0-...-7ebfda0 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2016 License: Apache-2.0 Imports: 8 Imported by: 0

README

go-whois

A simple whois client

Usage

resp, err := WhoisQuery("google.com")

if err != nil {
	t.Errorf("error when finding whois server = %s", err)
}

fmt.Printf("resp = %s\n", resp)

Docs

Dependencies

We use zonedb/zonedb to hold the record of whois servers.

Documentation

Index

Constants

View Source
const (
	DEFAULT_WHOIS_PORT  = "43"
	DEFAULT_TCP_TIMEOUT = time.Second * 10
)

Variables

This section is empty.

Functions

func WhoisQuery

func WhoisQuery(domain string) (string, error)

WhoisQuery accepts a domain and will return the full response of the whois query for the given domain. If the domain is invalid or whois fails an error will be returned.

Types

type WhoisRecord

type WhoisRecord struct {
	// times
	LastUpdatedAt time.Time
	CreatedAt     time.Time
	ExpiresAt     time.Time

	// contact points
	Registrar           string
	ContactEmails       []string
	ContactPhoneNumbers []string

	// tech details
	NameServers   []url.URL
	DNSSECEnabled bool
}

func ParseWhoisResponse

func ParseWhoisResponse(resp string) (WhoisRecord, error)

Jump to

Keyboard shortcuts

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