whois

package module
v0.0.0-...-c6d7879 Latest Latest
Warning

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

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

README

whois

License Build Status Go Report Card codecov

go whois client for domain names with support for proxied queries

Installation

go get -u github.com/FlyinDoji/whois

Usage

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

s, r, e := whois.Whois("verisign.com")
if e == nil {
  fmt.Println("Queried:", s)
  fmt.Println(r)
}


// Through a SOCKS5 proxy with authentication
addr := "address:port"
username := "user"
passwd := "password"

_, r, e := whois.Proxied("verisign.com", addr, whois.ProxyAuth(username, passwd))
if e == nil {
  fmt.Println(r)
}

// No authentication required
addr := "address:port"

_, r, e := whois.Proxied("verisign.com", addr, nil)
if e == nil {
  fmt.Println(r)
}

TODO

  1. Write tests for more TLDs
  2. Support for IP addresses
  3. Support for punycode TLDs
  4. Add more generic TLDs

Documentation

Index

Constants

View Source
const (
	Port            = ":43"
	ResponseTimeout = time.Duration(30) * time.Second
	TCPTimeout      = time.Duration(12) * time.Second
)

TCPTimeout is the time waited for contacting the Whois server ResponseTimeout is the time waited for the query to be served by the Whois server

Variables

This section is empty.

Functions

func OwnDialer

func OwnDialer(domain string, dialFun whoisDial) (string, string, error)

OwnDialer supply your own dial function

func Proxied

func Proxied(domain, proxyAddr string, p *proxy.Auth) (string, string, error)

Proxied queries the database of the domain's tld via SOCKS5 proxy Uses the proxy.Dialer.Dial function to contact the whois server p can be nil if no authentication is required

func ProxyAuth

func ProxyAuth(user, passwd string) *proxy.Auth

ProxyAuth authentication object for ProxiedWhois

func Whois

func Whois(domain string) (string, string, error)

Whois queries the database of the domain's tld Use the default net.Dial function to contact the whois server

Types

This section is empty.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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