hostname

package module
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2025 License: GPL-3.0 Imports: 8 Imported by: 4

README

Get() the full hostname for the OS.

  • only cares about the hostname in DNS
  • I wrote this before or not being aware of os.Hostname()

probably this package should go away

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrorDomainNameMisconfigured error = errors.New("your OS domain name is not configured correctly")
View Source
var ErrorEmptyDomainName error = errors.New("domain name is empty")

Functions

func Get

func Get() (string, error)

returns the hostname hostname is always set to the best effort error is set if hostname isn't real

func GetDomainname added in v0.0.4

func GetDomainname() (string, string, error)

for www.corp.wit.com retuns: "www", "corp.wit.com", nil

func GetWhois added in v0.0.4

func GetWhois(domain, server string) (string, error)

GetWhois performs a raw whois query for a given domain. Note: This does not recursively find the right server; it uses a known one.

func Join added in v0.0.4

func Join(hname string, dname string) string

func ReverseLookupFQDN added in v0.0.2

func ReverseLookupFQDN(hostname string) (string, error)

func Split added in v0.0.2

func Split(hname string) (string, string, error)

splits hostname into first and last part for www.corp.wit.com retuns: "www", "corp.wit.com", nil

func SplitOld added in v0.0.4

func SplitOld(s string) (string, string)

returns 'hostname', 'domainname'

func ValidDomainname added in v0.0.2

func ValidDomainname(s string) error

checks to make sure there is a domainname

Types

This section is empty.

Jump to

Keyboard shortcuts

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