package shared
import "github.com/elastic/go-sysinfo/providers/shared"
Index ¶
Functions ¶
func FQDN ¶
FQDN attempts to lookup the host's fully-qualified domain name and returns it. It does so using the following algorithm:
It gets the hostname from the OS. If this step fails, it returns an error.
It tries to perform a CNAME DNS lookup for the hostname. If this succeeds, it returns the CNAME (after trimming any trailing period) as the FQDN.
It tries to perform an IP lookup for the hostname. If this succeeds, it tries to perform a reverse DNS lookup on the returned IPs and returns the first successful result (after trimming any trailing period) as the FQDN.
If steps 2 and 3 both fail, an empty string is returned as the FQDN along with errors from those steps.
func Network ¶
Source Files ¶
- Version
- v1.11.1
- Published
- Aug 16, 2023
- Platform
- darwin/amd64
- Imports
- 4 packages
- Last checked
- 17 minutes ago –
Tools for package owners.