go-hostsfile: github.com/jaytaylor/go-hostsfile Index | Files

package hostsfile

import "github.com/jaytaylor/go-hostsfile"

Index

Package Files

hosts.go hosts_path_unix.go

Variables

var HostsPath = `/etc/hosts`

func ParseHosts Uses

func ParseHosts(hostsFileContent []byte, err error) (map[string][]string, error)

ParseHosts takes in hosts file content and returns a map of parsed results.

func ReadHostsFile Uses

func ReadHostsFile() ([]byte, error)

ReadHostsFile reads the hosts file.

func ReverseLookup Uses

func ReverseLookup(ip string) ([]string, error)

ReverseLookup takes an IP address and returns a slice of matching hosts file entries.

Package hostsfile imports 2 packages (graph). Updated 2019-09-09. Refresh now. Tools for package owners.