whois

package module
v0.0.0-...-6652a4c Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

README

whois

This is a fork of whois-go with tld database from ruby whois

Overview

whois.go: A golang module for domain whois query.

whois: A golang cli command for domain whois query.

Works for most domain extensions most of the time.

Installation

go get github.com/glebtv/whois

Importing

import (
    "github.com/glebtv/whois"
)

Documentation

func Whois(domain string) (whois.Result)

Example

result := whois.Whois("example.com")
if err == nil {
    spew.Dump(result)
}

Whois info parser in Go

Parser is called on whois result automatically.

Also some fields from whois (nameservers, created date, expiration date) have additional guess processing.

Please refer to whois-parser

LICENSE

Copyright 2018, GlebV

Copyright 2014-2018, Li Kexian

Apache License, Version 2.0

Documentation

Index

Constants

View Source
const (
	WHOIS_PORT = "43"
)

Variables

View Source
var TLDs map[string]TLD

Functions

func Query

func Query(domain string, server string) (result string, err error)

Types

type Result

type Result struct {
	Query       string
	Icann       bool
	TLD         string
	Server      TLD
	Raw         string
	Result      whois_parser.WhoisInfo
	Error       error
	Nameservers []string
	Created     time.Time
	Expires     time.Time
}

func Whois

func Whois(domain string) *Result

type TLD

type TLD struct {
	Group   string `json:"_group"`
	Type    string `json:"_type"`
	Adapter string `json:"adapter"`
	Host    string `json:"host"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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