Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddrsByHostName ¶
AddrsByHostName returns all ip addresses found for the provided hostname.
func HostAndAddr ¶
HostAndAddr returns the hostname and ip address of host whether host is an IP address or a hostname. HostAndAddr returns a non-nil error if host is an invalid ip address or a hostname that cannot be resolved to an IP address.
func HostNamesByIP ¶
HostNamesByIP returns all hostnames found for the provided ip address.
Types ¶
type InternetServiceProvider ¶
type InternetServiceProvider struct {
Name string `json:"name" table:"NAME"`
IP *net.IP `json:"ip_address" table:"IP"`
Country string `json:"country" table:"COUNTRY"`
Registry string `json:"registry" table:"REGISTRY"`
IpRange *net.IPNet `json:"ip_range" table:"IP_RANGE"`
AutonomousServiceNumber string `json:"autonomous_service_number" table:"ASN"`
AllocatedAt *time.Time `json:"allocated_at" table:"ALLOCATED_AT"`
}
InternetServiceProvider describes an internet service provider.
func ServiceProvider ¶
func ServiceProvider(ip *net.IP) (*InternetServiceProvider, error)
ServiceProvider returns the internet service provider information for ip.
type NameServer ¶
type NameServer struct {
IP net.IP `json:"ip" table:"IP"`
Host string `json:"nameserver" table:"Nameserver"`
}
NameServer is used in place of the standard library object to support table writes.
func NameServersByHostName ¶
func NameServersByHostName(hostname string) ([]NameServer, error)
NameServersByHostName looks up all nameservers for the provided hostname.
type NetworkRecord ¶
type NetworkRecord struct {
Hostname string `json:"hostname" yaml:"hostname,flow" table:"HOSTNAME"`
NetworkIP net.IP `json:"network" yaml:"network" table:"NETWORK"`
}
func NetworkByHost ¶
func NetworkByHost(host string) (*NetworkRecord, error)
NetworkByHost returns the network address for the provided hostname.
type Record ¶
type Record struct {
Hostname string `json:"hostname" yaml:"hostname" table:"HOSTNAME"`
IP net.IP `json:"ip" yaml:"ip" table:"IP_ADDRESS"`
}
Record can be used as a common type between lookup commands that supports json and table output.
func AddrByHostName ¶
AddrByHostName resolves the ip address of the provided hostname.
func HostNameByIP ¶
HostNameByIP returns the hostname for the provided ip address.